mapleFU commented on code in PR #41876:
URL: https://github.com/apache/arrow/pull/41876#discussion_r1631434845


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -1892,6 +1896,9 @@ class ObjectOutputStream final : public io::OutputStream {
     }
     // Notify completion
     if (--state->parts_in_progress == 0) {
+      // GH-41862: avoid potential deadlock if the Future's callback is called
+      // with the mutex taken.
+      lock.unlock();
       state->pending_parts_completed.MarkFinished(state->status);

Review Comment:
   ```c++
   auto fut = state->pending_parts_completed;
   lock.unlock();
   fut.MarkFinished(state->status);
   ```
   
   Maybe something can be done if we afraid `pending_parts_completed` changed, 
but I've checked that it wouldn't happens



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to