felipecrv commented on code in PR #41876: URL: https://github.com/apache/arrow/pull/41876#discussion_r1631567530
########## 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: `state->parts_in_progress` reached `0`, you unlock, another thread could increment `parts_in_progress` and now you call `MarkFinished`. Is `parts_in_progress > 0` considered "finished"? -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org