-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-12379: [C++] Fix ThreadSanitizer failure in SerialExecutor #10025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
cc @westonpace |
|
I've checked locally that this fixes the TSan failures. |
|
Submitted crossbow build: https://github.com/ursacomputing/crossbow/branches/all?query=build-226 |
lidavidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the issue was that we might be in the middle of SpawnReal on an external thread while the main thread was destructing the state (e.g. it exited early due to an error or something)?
|
Yes. |
|
Hm, wait, I shouldn't unlock before notifying in MarkFinished(). |
|
Additionally, since we're handing around Executor* instead of shared_ptr or something, there's still the possibility that an I/O thread tries to use a dangling reference, right? The main thread has to make sure to block and wait for all I/O threads it spawns under all conditions. |
|
Well, the idea is that the top-level task waits for all dependent tasks to finish, I think. |
|
True, it's just a potentially easy pitfall (though it comes with the territory I suppose). |
|
Things may get tricky if cancellation or early exit is involved indeed... |
9a07ed0 to
6e35a3f
Compare
|
Seems Crossbow built Arrow master, not this branch. I threw up https://github.com/lidavidm/crossbow/actions/runs/748753207 |
|
The crossbow job passes! |
|
Seemed the integration build timed out in Java but everything else passed. |
|
Thanks @pitrou . A few thoughts (nothing worrisome): Why
Cancellation should still flush the task queue. Early exit (via bad |
|
It's only for consistency, since |
No description provided.