Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-12042

Add force-stop to sonar.sh

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.8
    • Component/s: None
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      This option performs a clean shutdown of SonarQube with none to very short timeouts (basically the implementation of the stop option up to SONAR-12043). 

      The shutdown sequence should be as follow:

      • CE stops processing new tasks
      • CE waits at most 2 seconds before terminating any in progress task before forcefully shutting down
      • Web is stopped waiting at most 2 seconds for in progress HTTP requests to finish
      • ES is stopped with SIGTERM
      • the main process is stopped

      Since the SIGTERM signal is now handled to perform a graceful shutdown with large timeouts, implementation of this shutdown should now use another method. Ideas:

      • a first SIGTERM will trigger the graceful shutdown with large timeouts, a second (or more) SIGTERM signal received by SonarQube will trigger the shutdown sequence above this is impossible to implement this with the API offered by Java
      • SIGTERM triggers the graceful shutdown, a short Java program writing a flag to the shared memory will trigger the sequence above => watching for flag to be set in shared memory is already implemented (used by orchestrator to stop SQ), only the small Java program is missing
      • The shutdown hook checks for the presence of a file (can be empty) in a predictable location that would indicate the shutdown should be forced. The file name could have the process pid as a suffix to avoid the risk of being mistakenly used again if we fail to delete it. An ongoing graceful shutdown could also switch to forced using a `WatchService`.
      • ...

        Attachments

          Activity

            People

            Assignee:
            sebastien.lesaint Sebastien Lesaint
            Reporter:
            sebastien.lesaint Sebastien Lesaint
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: