GitHub user lulf opened a pull request:
https://github.com/apache/qpid-dispatch/pull/95
Ensure that only 1 signal handler runs at a time
When I ran qdrouterd with perf and precced Ctrl+C, perf would send SIGTERM
as well as SIGINT right after each other to the router.
Scenario:
Tthe first thread would pick up and handle the first signal in
handle_signals_LH(). However, within the function, it unlocks the
qd_server->lock before calling the registered handler.
When it unlocks this lock, some other thread will pick up the second signal
and jump into the qd_server_pause() code, where it will wait indefinitely for
threads to pause (I saw this in GDB, where 1 thread was 'missing', and all
others marked as canceled). The original handler will have canceled the thread
trying to pause all others, but it is not able to jump out.
This patch ensures that only 1 signal handler can run at a time, which
fixes the issue for me. Maybe another approach involving a signal handler lock
would be better, but this signal_handler_running variable is protected by the
qd_server->lock lock.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lulf/qpid-dispatch
lulf/serialize-signal-handling
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-dispatch/pull/95.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #95
----
commit 454784dbb2910d8ccd9feca5688861086bd9e204
Author: Ulf Lilleengen <[email protected]>
Date: 2016-08-22T17:56:08Z
Ensure that only 1 signal handler runs at a time
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]