Uh oh!
There was an error while loading. Please reload this page.
ARROW-12040: [C++] Fix potential deadlock in recursive S3 walks - #9842
ARROW-12040: [C++] Fix potential deadlock in recursive S3 walks#9842westonpace wants to merge 4 commits into
Conversation
524f5e0 to
0a556a6Comparepitrou
commented
Mar 30, 2021
Hmm, I'd rather not use |
westonpace
commented
Mar 30, 2021
I think it would end up using something very similar if not exactly TaskGroup in order to know when to write the end token to the generator. Something like Did you have an alternative approach in mind? |
pitrou
commented
Mar 30, 2021
I was thinking that this would make producing a stream of futures more difficult, but perhaps that's not the case actually. |
jonkeane
commented
Mar 30, 2021
It looks like the test that is hanging now is https://github.com/apache/arrow/blob/master/r/tests/testthat/test-dataset.R#L1345-L1367 which interestingly is skipped on windows reported in ARROW-9651. They might be different problems / solutions, but in case it provides clues about what might be going on. |
westonpace
commented
Mar 31, 2021
@jonkeane That second failure I have tracked now under ARROW-12161 @pitrou Future::All, Future::AllCompleted, and Future::Any (not sure if we've made this yet) are all related but none of them are really usable here since it is a recursive operation. I think some sort of future-centric solution could be devised but I don't see at the moment how it would be any nicer that TaskGroup. |
26a7da3 to
83b5babComparewestonpace
commented
Apr 5, 2021
I rebased and got rid of the R build changes (which have since been addressed by ARROW-12143) |
westonpace
commented
Apr 6, 2021
@pitrou R3.5 failure is known and unrelated. JNI failure & Travis failure appear to be spurious failures. Consider review/merge. |
There was a problem hiding this comment.
If you're capturing *this by value then you don't need to capture req and walker as well.
There was a problem hiding this comment.
Removed the extraneous captures.
There was a problem hiding this comment.
Is there a reason not to use std::mutex here?
There was a problem hiding this comment.
Nope. For some reason I thought the old implementation was using it. I've switched it back to std::mutex.
…tasks in flight. This makes the walker thread safe so we can get rid of the mutex ARROW-12040: Slight cleanup
…arious handlers as they are not thread safe
073ed9c to
e362029Comparewestonpace
commented
Apr 7, 2021
I believe I've addressed the PR comments, CI is green. This is ready for re-review/merge. |
pitrou
commented
Apr 7, 2021
@github-actions crossbow submit -g r |
Revision: df50ffe Submitted crossbow builds: ursacomputing/crossbow @ actions-274 |
pitrou
commented
Apr 7, 2021
Thanks a lot @westonpace , I'm merging now. |
From a deadlocked run...
The callback
ListObjectsV2Handleris being called recursively and the mutex is non-reentrant thus deadlock.To fix it I got rid of the mutex on
TreeWalkerby usingarrow::util::internal::TaskGroupinstead of manually tracking the #/status of in-flight requests.