Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6040

[PATCH] MariaDB hangs if terminated quickly after start

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.10
    • 10.0.11
    • None
    • None

    Description

      If MariaDB receives SIGTERM after the call to start_signal_handler() but before the call to init_slave() then kill_server_thread() will call close_connections() (through kill_server() ) which will ask all threads to terminate and will start to wait on COND_thread_count. After that init_slave() will be called, it will call run_slave_init_thread(), which will launch handle_slave_init() and will start to wait on COND_thread_count too. At this point if handle_slave_init() calls mysql_cond_signal(&COND_thread_count) then it can wake up close_connections() which will do nothing and return back to sleep. But run_slave_init_thread() will remain sleeping and no one will ever wake it up, MariaDB will hang forever with "kill -9" as the only chance to exit.

      So the call to mysql_cond_signal(&COND_thread_count) in the handle_slave_init() should be changed to mysql_cond_broadcast(&COND_thread_count).

      Note that calling *_broadcast instead of *_signal matches all other usages of COND_thread_count throughout MariaDB code.

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            pivanof Pavel Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.