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

chore: improve error of download config #4603

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

maan2003
Copy link
Member

now returns the correct error with added context

@maan2003 maan2003 marked this pull request as ready for review March 18, 2024 12:59
@maan2003 maan2003 requested a review from a team as a code owner March 18, 2024 12:59
elsirion
elsirion previously approved these changes Mar 18, 2024
Copy link
Contributor

@elsirion elsirion left a comment

Choose a reason for hiding this comment

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

Certainly an improvement, but candidate for further refactoring

fedimint-core/src/config.rs Outdated Show resolved Hide resolved
- use it in download client config
elsirion
elsirion previously approved these changes Mar 18, 2024
fedimint-core/src/util/mod.rs Outdated Show resolved Hide resolved
@maan2003 maan2003 enabled auto-merge March 18, 2024 14:41
@maan2003 maan2003 added this pull request to the merge queue Mar 18, 2024
op_name: impl Into<String>,
op_fn: F,
interval: Duration,
max_attempts: u32,
Copy link
Contributor

Choose a reason for hiding this comment

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

max_attempts < timeout , just saying.

Isn't this poll from devimint where I just added deadlines and turned interval to be growing? Can we move it here from there and rename?

Copy link
Contributor

Choose a reason for hiding this comment

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

That one uses ControlFlow, while here we want that to be implicitly implied by Result. retry could be implemented using poll though.

Copy link
Contributor

Choose a reason for hiding this comment

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

That control flow there is a bit of a PITA, BTW (because of type inference on two variants). Not sure how badly we need it. In testing if there's an error that should really terminate polling... maybe we should just panic, instead of complicating common case? Just thinking aloud.

But one way or the other - would prefer to see a timeout/deadline approach here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will leave it to @maan2003, don't have a strong opinion here.

Copy link
Member Author

@maan2003 maan2003 Mar 19, 2024

Choose a reason for hiding this comment

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

🤷 devimint and this retry can just stay separate

attempt + interval is pretty close to deadline though

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 18, 2024
@dpc dpc added this pull request to the merge queue Mar 18, 2024
@dpc
Copy link
Contributor

dpc commented Mar 18, 2024

Let's land it already, doesn't matter all that much in a great scheme of things, Manmeet is free to follow up (or not). :D

Merged via the queue into fedimint:master with commit fe32eb5 Mar 18, 2024
20 checks passed
@maan2003 maan2003 deleted the ma/jj-qquzrwnnkutr branch March 19, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants