You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Ulf Lilleengen (JIRA)" <ji...@apache.org> on 2016/08/22 18:38:20 UTC

[jira] [Created] (DISPATCH-478) Dispatch hung in shutdown due to multiple concurrent signal handlers

Ulf Lilleengen created DISPATCH-478:
---------------------------------------

             Summary: Dispatch hung in shutdown due to multiple concurrent signal handlers
                 Key: DISPATCH-478
                 URL: https://issues.apache.org/jira/browse/DISPATCH-478
             Project: Qpid Dispatch
          Issue Type: Bug
            Reporter: Ulf Lilleengen
            Priority: Minor


When I ran qdrouterd with perf and pressed Ctrl+C, perf would send SIGTERM as well as SIGINT right after each other to the router.

Scenario:

The 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.

Patch: https://github.com/apache/qpid-dispatch/pull/95

This patch ensures that only 1 signal handler can run at a time, which fixes the issue for me. Note that it will still potentially mask signals while handling a signal, but the current set of signals (SIGHUP, SIGQUIT, SIGINT, SIGTERM) either shutdown the router or do nothing.






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org