mq
  1. mq
  2. MQ-225

Imqbrokerd fails to start on a different port, if kill -9 the broker process then occupies the broker port by another application

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Glassfish v4 b45 Linux

      Description

      Imqbrokerd fails to start even if an available port number is specified.

      1.Start imqbrokerd with an instance name and port number. (Lock file is generated.)
      For example, execute the following command.

      # imqbrokerd -port 8000 -name instance1
      

      2.Kill the Java process for the imqbrokerd.
      For example, execute the following commands.

      # ps -eH
      # kill processnumber
      

      (Use -H option which displays the process hierarchy to identify the parent java process for imqbrokerd. )

      3. Confirm that there is lock file remaining.

      # ls -l glassfish/domains/domain1/imq/instances/instance1/lock
      

      4. Occupy the port 8000 with another application. For example, start any other user application that uses port 8000.

      5. Start imqbrokerd with the same instance name and different port number. (Lock file is generated.)
      For example, execute the following command.

      # imqbrokerd -port 8001 -name instance1
      

      This fails with the following error even though an available port is specified.

      [#|2012-10-25T10:09:03.377+1100|SEVERE|5.0|imq.log.Logger|_ThreadID=1;_ThreadName=main;|ERROR [B3087]: The broker has detected an active lock file:
      /usr/local/glassfish3/glassfish/domains/domain1/imq/instances/instance1/lock
      This file indicates that there is another copy of the broker running
      on localhost.localdomain:8000 that is also using the instance name "instance1".
      Please use a different instance name or terminate the broker on localhost.localdomain:8000.
      |#]
      

        Activity

        Hide
        amyk added a comment - - edited

        1. 'kill process' will send TERM signal to the process on Linux. In that case, the broker shutdown hook will be invoked and it will clean up the broker lock file. So assuming you were using kill -9

        2. If you kill -9 the broker process, and re-use the broker port to run for other application, and at same time expect to restart the broker on a different port using the same broker data store, you should remove the broker instance's lock file first. This is by design to protect the broker instance's data store.

        Show
        amyk added a comment - - edited 1. 'kill process' will send TERM signal to the process on Linux. In that case, the broker shutdown hook will be invoked and it will clean up the broker lock file. So assuming you were using kill -9 2. If you kill -9 the broker process, and re-use the broker port to run for other application, and at same time expect to restart the broker on a different port using the same broker data store, you should remove the broker instance's lock file first. This is by design to protect the broker instance's data store.

          People

          • Assignee:
            Ed Bratt
            Reporter:
            tak09
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: