Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iroh-blobs): Remove debugging logs & more cleanup #2690

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions iroh-blobs/src/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ impl<G: Getter<Connection = D::Connection>, D: Dialer> Service<G, D> {
entry.get_mut().intents.insert(intent_id, intent_handlers);
}
hash_map::Entry::Vacant(entry) => {
tracing::warn!("is new, queue");
Copy link
Contributor

@divagant-martian divagant-martian Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhhh this is(was) ugly

let progress_sender = self.progress_tracker.track(
kind,
intent_handlers
Expand All @@ -728,7 +727,9 @@ impl<G: Getter<Connection = D::Connection>, D: Dialer> Service<G, D> {
);

let get_state = match self.getter.get(kind, progress_sender.clone()).await {
Err(_err) => {
Err(err) => {
// This prints a "FailureAction" which is somewhat weird, but that's all we get here.
tracing::error!(?err, "failed queuing new download");
Comment on lines +730 to +732
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already return an error DownloadError::DownloadFailed which admittedly does not say a lot, but the error case is handled, so I honestly do not see what do we gain from this addition

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to log the error cause.

self.finalize_download(
kind,
[(intent_id, intent_handlers)].into(),
Expand Down
3 changes: 0 additions & 3 deletions iroh-blobs/src/downloader/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct Inner {

impl Inner {
fn subscribe(&mut self, subscriber: ProgressSubscriber) -> DownloadProgress {
tracing::warn!(state=?self.state, "subscribe! emit initial");
let msg = DownloadProgress::InitialState(self.state.clone());
self.subscribers.push(subscriber);
msg
Expand Down Expand Up @@ -137,9 +136,7 @@ impl ProgressSender for BroadcastProgressSender {
// making sure that the lock is not held across an await point.
let futs = {
let mut inner = self.shared.lock();
tracing::trace!(?msg, state_pre = ?inner.state, "send to {}", inner.subscribers.len());
inner.on_progress(msg.clone());
tracing::trace!(state_post = ?inner.state, "send");
let futs = inner
.subscribers
.iter_mut()
Expand Down
2 changes: 1 addition & 1 deletion iroh-blobs/src/get/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ pub enum DownloadProgress {
/// The offset of the progress, in bytes.
offset: u64,
},
/// We are done with `id`, and the hash is `hash`.
/// We are done with `id`.
Done {
/// The unique id of the entry.
id: u64,
Expand Down
2 changes: 1 addition & 1 deletion iroh-blobs/src/get/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl TransferState {
warn!(%id, "Received `Done` event for unknown progress id.")
}
}
_ => {}
DownloadProgress::AllDone(_) | DownloadProgress::Abort(_) => {}
}
}
}
Loading