Skip to content

Commit 1168ff8

Browse files
authored
chore(tracing): improve bundle tracing, break when receiver is dropped (#115)
* chore(tracing): improve bundle tracing, break when receiver is dropped * chore: don't warn and bail * chore: clippy * chore: improve bundle logging * chore: log on ingestion into cache * chore: rm tracing changes * chore: rm tx traces
1 parent 1dbd87b commit 1168ff8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/tasks/cache/bundle.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//! Bundler service responsible for fetching bundles and sending them to the simulator.
22
use crate::config::BuilderConfig;
3+
use eyre::bail;
34
use init4_bin_base::{
4-
deps::tracing::{Instrument, debug, debug_span, error, trace, warn},
5+
deps::tracing::{Instrument, debug, debug_span, error, trace},
56
perms::SharedToken,
67
};
78
use oauth2::TokenResponse;
@@ -46,8 +47,7 @@ impl BundlePoller {
4647
pub async fn check_bundle_cache(&mut self) -> eyre::Result<Vec<TxCacheBundle>> {
4748
let bundle_url: Url = Url::parse(&self.config.tx_pool_url)?.join("bundles")?;
4849
let Some(token) = self.token.read() else {
49-
warn!("No token available, skipping bundle fetch");
50-
return Ok(vec![]);
50+
bail!("No token available, skipping bundle fetch");
5151
};
5252

5353
self.client
@@ -89,10 +89,12 @@ impl BundlePoller {
8989
.await
9090
.inspect_err(|err| debug!(%err, "Error fetching bundles"))
9191
{
92+
let _guard = span.entered();
9293
debug!(count = ?bundles.len(), "found bundles");
9394
for bundle in bundles.into_iter() {
9495
if let Err(err) = outbound.send(bundle) {
9596
error!(err = ?err, "Failed to send bundle - channel is dropped");
97+
break;
9698
}
9799
}
98100
}

0 commit comments

Comments
 (0)