mapleFU commented on code in PR #41876:
URL: https://github.com/apache/arrow/pull/41876#discussion_r1633630523
##########
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:
> the user called blocking Close or Flush and the future is waited upon
before returning from the API call;
Maybe there could be a sequence:
1. A last request finished, acquire lock, dec count, and set it to 0
2. New request sent, `pending_parts_completed` set to a new one
3. (1) call `pending_parts_completed.MarkFinished`, which may call on the
new one
So the further blocking would wrong?
--
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]