-
Notifications
You must be signed in to change notification settings - Fork 6
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: removed try_join
to await futures
#337
Conversation
@frolvanya Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 2! Another weekly streak completed, well done @frolvanya! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
@@ -596,13 +596,13 @@ pub enum ShadowDataConsistencyError { | |||
#[derive(Debug)] | |||
pub enum DataMismatchReason { | |||
/// ReadRPC returns success result and NEAR RPC returns success result but the results mismatch | |||
ReadRpcSuccessNearRpcSuccess, | |||
SuccessNearRpcSuccess, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes bad naming practice, but it can cause some issues with metrics if it relies on old name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good. Left a couple of comments. Thanks
This triggered cargo clippy warning messages, so I decided to use `call_result.block...` instead of `block.block...`
df51e49
to
eee0597
Compare
Fixed. Thanks for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
🥁 Score it! @kobayurii, please score the PR with |
This PR fixes a misconception behind
try_join
method. It doesn't await until the finish state of all futures, but rather kills other futures if one one them returns an error. You can try it yourself:As you can see it doesn't print "Returning OK" to the stdout:
Now let's modify our code to use regular
join_all
instead and handle possible errors afterwards:And here's the new ouput which waits for both function to finish their execution before handling an error: