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

I/O simulation: always fail after the first failure #141

Merged
merged 1 commit into from
Oct 11, 2022

Conversation

Tpt
Copy link
Contributor

@Tpt Tpt commented Oct 10, 2022

It simulates better a disk or network error that the previous behavior of only failing once.

It simulates better a disk or network error that the previous behavior of only failing once.
@Tpt Tpt requested review from arkpar and cheme October 11, 2022 07:54
.fetch_update(
::std::sync::atomic::Ordering::SeqCst,
::std::sync::atomic::Ordering::SeqCst,
|v| Some(v.saturating_sub(1)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could also |v| Some(v - 1). And compare to 1, but saturating and compare to 0 may be more readable. Looks good.

@cheme cheme merged commit 5afbfcc into paritytech:master Oct 11, 2022
@Tpt Tpt deleted the io_simul_fail branch October 11, 2022 09:40
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.

3 participants