Skip to content

Commit 857e513

Browse files
authored
fix(iroh-blobs): Remove debugging logs & more cleanup (#2690)
## Description More stuff to clean up I came across while trying to debug an issue. Also, this makes it so that errors from `iroh_blobs::get::db::get_blob` that happen *before* the `get_conn` step get printed. <!-- A summary of what this pull request achieves and a rough list of changes. --> ## Breaking Changes None. <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> I decided to just remove the tracing logs in `downloader/progress.rs`. They never really helped us surface the bug, they mostly polluted the logs, to be honest. The only thing they surfaced was that we didn't properly clean up `TransferState::progress_id_to_blob` when there's an error in `iroh_blobs::get::db::get_blob` that causes us to not send the `DownloadProgress::Done` event. ## Change checklist - [x] Self-review. - ~~[ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant.~~ - ~~[ ] Tests if relevant.~~ - [x] All breaking changes documented.
1 parent 19c8fd3 commit 857e513

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

iroh-blobs/src/downloader.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ impl<G: Getter<Connection = D::Connection>, D: Dialer> Service<G, D> {
717717
entry.get_mut().intents.insert(intent_id, intent_handlers);
718718
}
719719
hash_map::Entry::Vacant(entry) => {
720-
tracing::warn!("is new, queue");
721720
let progress_sender = self.progress_tracker.track(
722721
kind,
723722
intent_handlers
@@ -728,7 +727,9 @@ impl<G: Getter<Connection = D::Connection>, D: Dialer> Service<G, D> {
728727
);
729728

730729
let get_state = match self.getter.get(kind, progress_sender.clone()).await {
731-
Err(_err) => {
730+
Err(err) => {
731+
// This prints a "FailureAction" which is somewhat weird, but that's all we get here.
732+
tracing::error!(?err, "failed queuing new download");
732733
self.finalize_download(
733734
kind,
734735
[(intent_id, intent_handlers)].into(),

iroh-blobs/src/downloader/progress.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ struct Inner {
103103

104104
impl Inner {
105105
fn subscribe(&mut self, subscriber: ProgressSubscriber) -> DownloadProgress {
106-
tracing::warn!(state=?self.state, "subscribe! emit initial");
107106
let msg = DownloadProgress::InitialState(self.state.clone());
108107
self.subscribers.push(subscriber);
109108
msg
@@ -137,9 +136,7 @@ impl ProgressSender for BroadcastProgressSender {
137136
// making sure that the lock is not held across an await point.
138137
let futs = {
139138
let mut inner = self.shared.lock();
140-
tracing::trace!(?msg, state_pre = ?inner.state, "send to {}", inner.subscribers.len());
141139
inner.on_progress(msg.clone());
142-
tracing::trace!(state_post = ?inner.state, "send");
143140
let futs = inner
144141
.subscribers
145142
.iter_mut()

iroh-blobs/src/get/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ pub enum DownloadProgress {
663663
/// The offset of the progress, in bytes.
664664
offset: u64,
665665
},
666-
/// We are done with `id`, and the hash is `hash`.
666+
/// We are done with `id`.
667667
Done {
668668
/// The unique id of the entry.
669669
id: u64,

iroh-blobs/src/get/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl TransferState {
180180
warn!(%id, "Received `Done` event for unknown progress id.")
181181
}
182182
}
183-
_ => {}
183+
DownloadProgress::AllDone(_) | DownloadProgress::Abort(_) => {}
184184
}
185185
}
186186
}

0 commit comments

Comments
 (0)