Terminate and await signal executor to avoid races with at_exit.#5614
Terminate and await signal executor to avoid races with at_exit.#5614headius wants to merge 3 commits intojruby:masterfrom
Conversation
This avoids races due to the signal traps running on the JVM's signal-handling thread while we run at_exit blocks on JRuby's main thread. Fixes jruby#5437.
|
This looks like it might go green, but it was responsible for a verbose error being logged on master when a Fiber executor job was rejected. |
|
The issues with the original PR are explained here: #5437 (comment) We'll get this into 9.2.8 |
|
@Adithya-copart I'm not sure where we left this. I filed these changes before you came back with #5437 (comment) and suggested the original issue be closed. Is the additional work in this PR no longer necessary? |
|
Detargeting since it's unclear if this is appropriate or necessary. Will be closed without further follow-up. |
|
@headius This PR is no longer necessary as the main thread actually waits for the signal executors. The issue I came across is that the main thread is being shutdown within the trap handlers. The at_exit blocks were partially executed which I mistakenly assumed to be a race condition between traps and at_exit handlers. It was later fixed in puma here. |
|
@Adithya-copart Ok thank you. We are debating whether to include PR #5918 which might help such situations by warning that there's unterminated threads at exit. |
This restores #5441 for additional work before it is merged or dropped.