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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.34
    • Fix Version/s: 5.5
    • Component/s: None
    • Labels:
    • Environment:
      Linux

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  hhorak Honza Horak
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated: