]
Simone Gotti updated AS7-5662:
------------------------------
Git Pull Request:
Cannot start a managed server anymore if it's failed and the host
controller is reloaded/restarted
--------------------------------------------------------------------------------------------------
Key: AS7-5662
URL:
https://issues.jboss.org/browse/AS7-5662
Project: Application Server 7
Issue Type: Bug
Components: Domain Management
Affects Versions: 7.1.3.Final (EAP), 7.2.0.Alpha1
Reporter: Simone Gotti
Assignee: Simone Gotti
Fix For: 7.2.0.Alpha1
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/306db0fbfcb74a6c6781f7918877e1...
(master)
https://github.com/motaboy/jboss-as/commit/2a96fd496c8745507b38b3d69e49f3...
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/be3260b1b1ff4fb5ffc545f395f216...
(master)
https://github.com/motaboy/jboss-as/commit/b17692716c9c32ee40d78424dcb542...
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/b321db77db298871a39c0a445c73db...
(master)
https://github.com/motaboy/jboss-as/commit/c88c595ee657b45cbfebe8eac4b5ab...
Thanks!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: