Skip to content

Commit

Permalink
[ENH] Clean up the errors reported by chroma-load.
Browse files Browse the repository at this point in the history
It won't report 429's to stderr, and logs just once per error.
  • Loading branch information
rescrv committed Jan 6, 2025
1 parent 39c0e42 commit 1782c08
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions rust/load/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub async fn client_for_url(url: String) -> ChromaClient {
header: ChromaTokenHeader::XChromaToken,
},
database: "hf-tiny-stories".to_string(),
connections: 4,
connections: 32,
})
.await
.unwrap()
Expand All @@ -138,7 +138,7 @@ pub async fn client_for_url(url: String) -> ChromaClient {
url: Some(url),
auth: ChromaAuthMethod::None,
database: "hf-tiny-stories".to_string(),
connections: 4,
connections: 32,
})
.await
.unwrap()
Expand Down Expand Up @@ -1097,9 +1097,7 @@ impl LoadService {
let inhibit = Arc::clone(&self.inhibit);
let task = tokio::task::spawn(async move {
let _enter = root.enter();
this.run_one_workload(done, inhibit, declared)
.instrument(tracing::info_span!("run one workload"))
.await
this.run_one_workload(done, inhibit, declared).await
});
entry.insert((done_p, task));
}
Expand All @@ -1123,7 +1121,9 @@ impl LoadService {
let reaper = tokio::spawn(async move {
while let Some(task) = rx.recv().await {
if let Err(err) = task.await.unwrap() {
tracing::error!("workload task failed: {err:?}");
if !format!("{err:?}").contains("429") {
tracing::error!("workload task failed: {err:?}");
}
}
}
});
Expand Down Expand Up @@ -1196,12 +1196,7 @@ impl LoadService {
workload
.step(&client, &this.metrics, &*data_set, &mut state)
.await
.map_err(|err| {
if !format!("{err:?}").contains("429") {
tracing::error!("workload failed: {err:?}");
}
Error::FailWorkload(err.to_string())
})
.map_err(|err| Error::FailWorkload(err.to_string()))
};
tx.send(tokio::spawn(fut)).await.unwrap();
}
Expand Down

0 comments on commit 1782c08

Please sign in to comment.