From e2e47fb67c1c45059e8326fd2b24ffb63c5a1957 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Thu, 18 Jan 2024 14:54:51 +0800 Subject: [PATCH] fix: async fn resumed after initiate part failed Signed-off-by: Xuanwo --- core/src/raw/oio/write/multipart_write.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/raw/oio/write/multipart_write.rs b/core/src/raw/oio/write/multipart_write.rs index 3ca119144000..60c6f7d52984 100644 --- a/core/src/raw/oio/write/multipart_write.rs +++ b/core/src/raw/oio/write/multipart_write.rs @@ -272,8 +272,9 @@ where } State::Init(fut) => { let upload_id = ready!(fut.as_mut().poll(cx)); - self.upload_id = Some(Arc::new(upload_id?)); + // Make sure the future is dropped after it returned ready. self.state = State::Idle; + self.upload_id = Some(Arc::new(upload_id?)); } State::Close(_) => { unreachable!("MultipartWriter must not go into State::Close during poll_write")