Skip to content

Commit

Permalink
Fetch all entries when listing assigned producers (#5373)
Browse files Browse the repository at this point in the history
This works around a confusing interface in Progenitor, which lists the
second argument to the `*_stream()` methods as a `limit`, but which
describes it as a page size. It currently is the former, a total limit
on all entries, so this change ensures we refresh our producer entire
producer list.
  • Loading branch information
bnaecker authored Apr 2, 2024
1 parent bb26b0a commit 64b288d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oximeter/collector/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use std::collections::btree_map::Entry;
use std::collections::BTreeMap;
use std::net::SocketAddr;
use std::net::SocketAddrV6;
use std::num::NonZeroU32;
use std::ops::Bound;
use std::sync::Arc;
use std::sync::Mutex as StdMutex;
Expand Down Expand Up @@ -748,7 +747,6 @@ impl OximeterAgent {
// A task which periodically updates our list of producers from Nexus.
async fn refresh_producer_list(agent: OximeterAgent, resolver: Resolver) {
let mut interval = tokio::time::interval(agent.refresh_interval);
let page_size = Some(NonZeroU32::new(100).unwrap());
loop {
interval.tick().await;
info!(agent.log, "refreshing list of producers from Nexus");
Expand All @@ -758,7 +756,9 @@ async fn refresh_producer_list(agent: OximeterAgent, resolver: Resolver) {
let client = nexus_client::Client::new(&url, agent.log.clone());
let mut stream = client.cpapi_assigned_producers_list_stream(
&agent.id,
page_size,
// This is a _total_ limit, not a page size, so `None` means "get
// all entries".
None,
Some(IdSortMode::IdAscending),
);
let mut expected_producers = BTreeMap::new();
Expand Down

0 comments on commit 64b288d

Please sign in to comment.