From 959126f9f6edce16d4ee95954091b93e33a83140 Mon Sep 17 00:00:00 2001 From: bigmurry <12495406+BigMurry@users.noreply.github.com> Date: Thu, 22 Dec 2022 00:16:34 +0800 Subject: [PATCH] fix: async protocol may stuck at the last round forever if messages not coming by order (#10) --- src/async_runtime/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/async_runtime/mod.rs b/src/async_runtime/mod.rs index fe801cb..62ea3c4 100644 --- a/src/async_runtime/mod.rs +++ b/src/async_runtime/mod.rs @@ -178,7 +178,7 @@ where async fn proceed_if_needed(&mut self) -> Result<(), Error> { let mut state = self.state.take().ok_or(InternalError::MissingState)?; - if state.wants_to_proceed() { + while state.wants_to_proceed() { let (result, s) = tokio::task::spawn_blocking(move || (state.proceed(), state)) .await .map_err(Error::ProceedPanicked)?;