Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Fix potential sleep with lock #243

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ where
let time_to_wait_for_matching_builder = starting_time + self.max_api_waiting_time / 2;

let mut sent = false;
while !sent && Instant::now() < time_to_wait_for_matching_builder {
while Instant::now() < time_to_wait_for_matching_builder {
// try to broadcast the request to the correct builder state
if let Some(builder) = self
.global_state
Expand All @@ -431,12 +431,11 @@ where
tracing::warn!("Error {e} sending get_available_blocks request for {state_id}",);
}
sent = true;
} else {
tracing::info!(
"Failed to get matching BlockBuilder for {state_id}, will try again",
);
async_sleep(check_duration).await
break;
}

tracing::info!("Failed to get matching BlockBuilder for {state_id}, will try again",);
async_sleep(check_duration).await;
}

if !sent {
Expand Down
Loading