Skip to content

Commit b9c5fcd

Browse files
authored
Fix race condition waiting for rounds. (#3099)
## 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 - Nothing to do / These changes follow the usual release cycle. ## Links - Issue to revisit this: #3100 - Bug was introduced/revealed in: #2961 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 5e2cf7e commit b9c5fcd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

linera-client/src/client_context.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ where
435435

436436
loop {
437437
// Try applying f. Return if committed.
438+
client.prepare_chain().await?;
438439
let result = f(client).await;
439440
self.update_and_save_wallet(client).await?;
440441
let timeout = match result? {

0 commit comments

Comments
 (0)