Uploaded image for project: 'ProxySQL Admin Scripts'
  1. ProxySQL Admin Scripts
  2. PSQLADM-125

The function "check_is_galera_checker_running" isn't preventing multiple instances of the script from running

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Pending Release
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.12
    • Component/s: None
    • Labels:
      None

      Description

      The function  exit check_is_galera_checker_running should force the script to exit if another instance of the script is running but it sometimes fails to do so. 

       

      One of the problems is when the GPID check fails it only emits a warning saying that the GPID belongs to some other process but creates a new process and replace the PID inside of the file.

       

      Steps to reproduce:

      • Jus add a "sleep" in the beginning of the file to simulate a long running task and wait for a few minutes:

       

      set -o nounset # no undefined variables
      sleep 30
      

      Then is possible to see the many instances of the script running:

      root     21038  0:25  \_ proxysql -c /etc/proxysql.cnf -D /var/lib/proxysql
      root      8950  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10654  0:00      |   \_ /bin/bash -u /usr/bin/proxysql_node_monitor --config-fi
      root     10684  0:00      |       \_ /bin/bash -u /usr/bin/proxysql_node_monitor --confi
      root     10692  0:00      |           \_ /bin/bash -u /usr/bin/proxysql_node_monitor --c
      root     11225  0:00      |               \_ /bin/bash -u /usr/bin/proxysql_node_monitor
      root      9214  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10979  0:00      |   \_ /bin/bash -u /usr/bin/proxysql_node_monitor --config-fi
      root     11009  0:00      |       \_ /bin/bash -u /usr/bin/proxysql_node_monitor --confi
      root     11018  0:00      |           \_ /bin/bash -u /usr/bin/proxysql_node_monitor --c
      root     11234  0:00      |               \_ /bin/bash -u /usr/bin/proxysql_node_monitor
      root      9419  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     11182  0:00      |   \_ /bin/bash -u /usr/bin/proxysql_node_monitor --config-fi
      root     11212  0:00      |       \_ /bin/bash -u /usr/bin/proxysql_node_monitor --confi
      root     11220  0:00      |           \_ /bin/bash -u /usr/bin/proxysql_node_monitor --c
      root     11221  0:00      |               \_ /bin/bash -u /usr/bin/proxysql_node_monitor
      root      9621  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root      9831  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root      9881  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10088  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10296  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10503  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10709  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     10763  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     11039  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e
      root     11238  0:00      \_ /bin/bash /usr/bin/proxysql_galera_checker --config-file=/e

        Attachments

          Activity

            People

            • Assignee:
              kenn.takara Kenn Takara
              Reporter:
              charly.batista Charly Batista
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours, 4 minutes
                1d 4h 4m