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

Conversation

matheus23
Copy link
Contributor

@matheus23 matheus23 commented Sep 2, 2024

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.

Breaking Changes

None.

Notes & open questions

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

  • Self-review.
  • [ ] Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • All breaking changes documented.

@matheus23 matheus23 self-assigned this Sep 2, 2024
Copy link

github-actions bot commented Sep 2, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2690/docs/iroh/

Last updated: 2024-09-02T16:01:23Z

@matheus23 matheus23 marked this pull request as ready for review September 25, 2024 10:34
@matheus23
Copy link
Contributor Author

I originally planned to see if this helps surface some issues Pasha was seeing & if so, perhaps add more updates to this branch.
But now I'm more in favor of just getting these changes into main and moving on.
This basically does a bunch of small cleanups in the logs, removing some logs for debugging and logging a category of errors that would otherwise be silenced.

Comment on lines +730 to +732
Err(err) => {
// This prints a "FailureAction" which is somewhat weird, but that's all we get here.
tracing::error!(?err, "failed queuing new download");
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
Contributor 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.

@@ -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

@matheus23
Copy link
Contributor Author

@divagant-martian did you intentionally enable auto-merge? You didn't approve the PR 😅

@divagant-martian
Copy link
Contributor

I did. I also wanted to know what were you looking for by logging that error. It's still better than before so let's go ahead

@divagant-martian divagant-martian added this pull request to the merge queue Sep 26, 2024
Merged via the queue into main with commit 857e513 Sep 26, 2024
31 checks passed
@matheus23
Copy link
Contributor Author

what were you looking for by logging that error

There's a thread in discord that has some details.

More specifically, any errors in iroh_blobs::get::db::get_blob before its call to co.get_conn().await get swallowed and just reported as DownloadFailed.
I suspected that Pasha's issues might have occurred in that part of the code, so wanted to log the actual errors.

I hope I remember the part of the code correctly - following the whole call structure took some time. But as far as I remember failures end up as this FailureAction error type returned from self.getter.get (in the place in this PR's diff).

@matheus23 matheus23 deleted the matheus23/more-cleanup branch September 27, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants