From 64b288d94d6f3128be6d03764429e23d242a8b02 Mon Sep 17 00:00:00 2001 From: bnaecker Date: Mon, 1 Apr 2024 22:22:47 -0700 Subject: [PATCH] Fetch all entries when listing assigned producers (#5373) 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. --- oximeter/collector/src/agent.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oximeter/collector/src/agent.rs b/oximeter/collector/src/agent.rs index d3ed56a7a7..7b51b62921 100644 --- a/oximeter/collector/src/agent.rs +++ b/oximeter/collector/src/agent.rs @@ -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; @@ -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"); @@ -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();