Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-478

Dispatch hung in shutdown due to multiple concurrent signal handlers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.7.0
    • None
    • None
    • Patch

    Description

      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.

      Attachments

        Activity

          People

            lulf Ulf Lilleengen
            lulf Ulf Lilleengen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: