Fix race condition waiting for rounds. #3099
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
test_end_to_end_listen_for_new_rounds::storage_test_service_grpc
is flaky for me locally and sometimes hangs, even though it seems fine on CI.The logs suggest that the two clients are both waiting for round notifications forever, even though one of them should be the leader in the current round.
Proposal
Adding an explicit
prepare_chain
fixes the issue.It's not quite clear why this is necessary, so I created #3100.
Test Plan
Running the test in a loop locally failed quite often. With this change it passed 50 times in a row.
Release Plan
Links
test_end_to_end_listen_for_new_rounds::storage_test_service_grpc
notification issue. #3100