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

LP:870310 - killall -9 in init-script

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.2, 5.5.31
    • 10.0.4, 5.5.32
    • None

    Description

      From /etc/init.d/mysql

      #v+
        'stop')
              # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
              # at least for cron, we can rely on it here, too. (although we have 
              # to specify it explicit as e.g. sudo environments points to the normal
              # users home and not /root)
              log_daemon_msg "Stopping MariaDB database server" "mysqld"
              if ! mysqld_status check_dead nowarn; then
                set +e
                shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
                set -e
                if [ "$r" -ne 0 ]; then
                  log_end_msg 1
                  [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
                  log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
                  killall -15 mysqld
                  server_down=
                  for i in 1 2 3 4 5 6 7 8 9 10; do
                    sleep 1
                    if mysqld_status check_dead nowarn; then server_down=1; break; fi
                  done
                if test -z "$server_down"; then killall -9 mysqld; fi
                fi
              fi
      #v-

      First I see no reason to use anything else than killall -15.
      But:
      Imagine the connections of the server are exhausted. Then after the killall -15 the server has 10 seconds to stop. After that a SIGKILL is gonna send.
      Now if the shutdown is going to take some time especially for bigger databases with i.e. delay_key_write. The database is going to be corrupted afterwards.
      Anyway a recovery is being forced.
      So this is going to hurt bigger installations more likely.
      It is also likely mysqladmin is going to fail, because you installed a dump from another server (then /etc/mysql/debian.cnf will not match the credentials in the server anymore)

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              erkanyanar Erkan Yanar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.