Skip to content

fix(inproc): only the handling thread cleans up#1579

Merged
supervacuus merged 2 commits intomasterfrom
fix/inproc_only_handling_thread_cleansup
Mar 14, 2026
Merged

fix(inproc): only the handling thread cleans up#1579
supervacuus merged 2 commits intomasterfrom
fix/inproc_only_handling_thread_cleansup

Conversation

@supervacuus
Copy link
Collaborator

@supervacuus supervacuus commented Mar 14, 2026

fixes #1578

The cleanup bypass of the CAS losers might have been a merge victim when I picked up the PR again in February; this was certainly the idea that only the winner cleans up.

Maybe let's stay somewhere at SDK 24-26 in #1572, merge this first, and then merge this change from master into your branch.

I think the basic idea behind the analysis is sound, even if the explanation around the mutex where the threads are stuck seems very handwavy. I think this is just a symptom, and the actual cause has more to do with how re-raising from within signal handlers is handled vs. what happens when a fresh signal from the kernel arrives.

However, if we are lucky, it loosens the contention enough for our process to terminate; in that case, we should see the behavior in the previously affected platform versions.

@supervacuus supervacuus requested a review from jpnurmi March 14, 2026 16:50
Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified - no hangs during 50x test runs. Thank you! 🙏

@supervacuus supervacuus merged commit d46426b into master Mar 14, 2026
52 checks passed
@supervacuus supervacuus deleted the fix/inproc_only_handling_thread_cleansup branch March 14, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: inproc stress test deadlocks (API 24-27)

2 participants