Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5662

Cannot start a managed server anymore if it's failed and the host controller is reloaded/restarted

    XMLWordPrintable

Details

    Description

      This issue should incorporate the one reported in AS7-4981.

      I opened a new one just to describe the problem and various possible fixes.
      I can reproduce it with also with the latest 7.1 and master branches.

      Before creating a pull request I'll like to know what you think about the possibile patches provided below.

      The problem can happen also if a server is failed and you restart/reload the host controller after some time (not only when you kill the managed server and the host controller together). The unique fix is to restart the process controller and so all the managed servers...

      The problem is that, when the host controller reloads/restarts it receives the registered processes from the process controller and a Failed process is marked as not running (the value of isRunning was also broken before the fix in AS7-5610).

      In the host controller a new ManagedServer is created with internalState and requiredState defined as STOPPED.

      So:

      *) When you ask for a start of the managed server it will start trying to register the managed server with the process controller but as it's already registered the process controller will return a warning (JBAS012004: Attempted to register duplicate named process %s) and no callback to the host controller will happen living the managed server in a PROCESS_ADDING state.

      *) When you ask for a stop of the managed server you'll get that you cannot stop and already stopped server.

      I tried to fix this with this patch:

      (7.1) https://github.com/motaboy/jboss-as/commit/306db0fbfcb74a6c6781f7918877e1fc65529594
      (master) https://github.com/motaboy/jboss-as/commit/2a96fd496c8745507b38b3d69e49f3d9864f62ea

      With this patch if the process state returned by the process controller is not running then the host controller will deregister the managed server from the process controller.

      Another case is when you ask a process to stop and while it's stopping you'll reload/restart/kill the host controller. With the above patch the managed server will be deregistred from the process controller, then when the processFinished notification is received an error (JBAS010913: No server called %s available) as it was already removed from the ServerInventory on the host controller. Apart from the error this is not a problem as you can start the server without any problem.

      I made another patch to handle also this situation. To handle it the host controller needs to know if the process is really down, or it's up but stopping. So I added also this information to the one returned by the process controller (in the meantime I also changed isRunning to return true also if the process is up but stopping)

      (7.1) https://github.com/motaboy/jboss-as/commit/be3260b1b1ff4fb5ffc545f395f216837f82b3d7
      (master) https://github.com/motaboy/jboss-as/commit/b17692716c9c32ee40d78424dcb542156cc059aa

      I also modified the RespawnTestCase to test also the first case (managed server failed and host controller is reloaded) (this test was disabled by AS7-5242):

      (7.1) https://github.com/motaboy/jboss-as/commit/b321db77db298871a39c0a445c73dbe512294728
      (master) https://github.com/motaboy/jboss-as/commit/c88c595ee657b45cbfebe8eac4b5ab37b6983a24

      Thanks!

      Attachments

        Issue Links

          Activity

            People

              simone.gotti_jira Simone Gotti (Inactive)
              simone.gotti_jira Simone Gotti (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: