SonarQube
  1. SonarQube
  2. SONAR-2937

Disallow start of multiple instances of an application at the same time on Windows

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.12
    • Component/s: Wrapper
    • Labels:
      None
    • Environment:
      Windows
    • Number of attachments :
      0

      Description

      Current behaviour on Linux :

      $ ./sonar.sh start
      Starting sonar...
      Started sonar.
      
      $ ./sonar.sh start
      Starting sonar...
      sonar is already running.
      

      i.e. only one running instance.

      And current behaviour on Windows :

      > StartSonar.bat
      Launching a JVM...
      
      > StartSonar.bat
      Launching a JVM...
      

      i.e. several running instances - for example it's possible to start one instance using service and another one from console.

      Thus we have an inconsistency in behaviour under different OSs. And moreover in case of Windows this behaviour is misleading and error-prone.

      So IMO would be better to disallow multiple instances on Windows. In order to do this following options should be added to wrapper.conf ( http://wrapper.tanukisoftware.com/doc/english/prop-single-invocation.html ) :

      wrapper.single_invocation=true
      

      With this option enabled, attempt to start second instance will lead to a following message :

      wrapper  | ERROR: Another instance of the Sonar application is already running.
      

        Issue Links

          Activity

          Evgeny Mandrikov made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Evgeny Mandrikov added a comment -

          Done in 356ce27.

          Show
          Evgeny Mandrikov added a comment - Done in 356ce27 .
          Evgeny Mandrikov made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Evgeny Mandrikov added a comment -

          Dinesh, I've manually tested this on Windows XP and Windows 7, however would be nice if you can verify this too.

          Show
          Evgeny Mandrikov added a comment - Dinesh, I've manually tested this on Windows XP and Windows 7, however would be nice if you can verify this too.
          Evgeny Mandrikov made changes -
          Assignee Evgeny Mandrikov [ godin ] Dinesh Bolkensteyn [ dinesh.bolkensteyn ]
          Hide
          Dinesh Bolkensteyn added a comment -

          Evgeny, it seems that, when Sonar is already running as a service, and that I am trying to launch StartSonar.bat, I just get:

          wrapper  | --> Wrapper Started as Console
          wrapper  | Launching a JVM...
          jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
          jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
          jvm 1    |
          

          And nothing else is happening.

          Vice-versa, I can also start the service is the foreground Sonar is already running.

          However, I am indeed unable to start the service twice at the same time, or the foreground Sonar twice at the same time.

          Show
          Dinesh Bolkensteyn added a comment - Evgeny, it seems that, when Sonar is already running as a service, and that I am trying to launch StartSonar.bat, I just get: wrapper | --> Wrapper Started as Console wrapper | Launching a JVM... jvm 1 | Wrapper (Version 3.2.3) http: //wrapper.tanukisoftware.org jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved. jvm 1 | And nothing else is happening. Vice-versa, I can also start the service is the foreground Sonar is already running. However, I am indeed unable to start the service twice at the same time, or the foreground Sonar twice at the same time.
          Dinesh Bolkensteyn made changes -
          Assignee Dinesh Bolkensteyn [ dinesh.bolkensteyn ] Evgeny Mandrikov [ godin ]
          Evgeny Mandrikov made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Evgeny Mandrikov added a comment -

          Well, this doesn't happen on Windows XP, so I suppose that this relates to changes of security in Windows 7 and to the fact that StartSonar.bat uses current user, whereas Service uses special user. I inclined to close this ticket as is, because I don't see way to improve it more.

          Show
          Evgeny Mandrikov added a comment - Well, this doesn't happen on Windows XP, so I suppose that this relates to changes of security in Windows 7 and to the fact that StartSonar.bat uses current user, whereas Service uses special user. I inclined to close this ticket as is, because I don't see way to improve it more.
          Evgeny Mandrikov made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Evgeny Mandrikov made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Evgeny Mandrikov made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Freddy Mallet made changes -
          Link This issue is related to SONAR-3964 [ SONAR-3964 ]

            People

            • Assignee:
              Evgeny Mandrikov
              Reporter:
              Evgeny Mandrikov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: