You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/01/18 07:55:37 UTC

(incubator-opendal) branch main updated: fix: async fn resumed after initiate part failed (#4013)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 223e8106cd fix: async fn resumed after initiate part failed (#4013)
223e8106cd is described below

commit 223e8106cdb691d2e48eeeb69e3178b087a41e72
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Jan 18 15:55:29 2024 +0800

    fix: async fn resumed after initiate part failed (#4013)
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 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 3ca1191440..60c6f7d529 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")