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

mysqld daemon should check if any process uses the socket file before removing

    XMLWordPrintable

Details

    Description

      Already reported to http://bugs.mysql.com/71194

      When running some MySQL daemon A and we are trying to run another instance B, while these conditions are met:

      • network ports are different for A and B
      • unix socket location is the same for A and B

      Then the new daemon B removes the unix socket file that is actually necessary for daemon A.

      How to repeat:
      Steps to reproduce:
      $ /usr/libexec/mysqld --port 13306 --datadir /var/lib/mysql/
      $ fuser /var/lib/mysql/mysql.sock
      $ /usr/libexec/mysqld --port 13307 --datadir /var/lib/mysql2/
      $ fuser /var/lib/mysql/mysql.sock

      Actual results:
      /var/lib/mysql/mysql.sock: 5683
      /var/lib/mysql/mysql.sock: 5717
      which means the first daemon is not able to accept connections on the unix socket

      Expected results:
      /var/lib/mysql/mysql.sock: 5683
      /var/lib/mysql/mysql.sock: 5683
      the second daemon shouldn't start at all

      Suggested fix:
      Either check if some proc is attached to the socket or (portable solution) having a lock file for the socket file, that would contain pid of the process using the socket file.

      Attachments

        Activity

          People

            danblack Daniel Black
            hhorak Honza Horak
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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