[jboss-jira] [JBoss JIRA] (WFCORE-1715) HostProcessReloadHandler does not reset the HostRunningModeControl's restartMode

Yeray Santana Borges (JIRA) issues at jboss.org
Sun Aug 28 09:00:00 EDT 2016


    [ https://issues.jboss.org/browse/WFCORE-1715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284517#comment-13284517 ] 

Yeray Santana Borges edited comment on WFCORE-1715 at 8/28/16 8:59 AM:
-----------------------------------------------------------------------

I have arrived to these conclusions after taking a look to the code around this issue:

# It seems that the RestartMode has already a default value, created in the constructor of HostRunningModeControl. It's initialized to RestartMode.SERVERS in a single point: HostControllerEnvironment L298. Its setter is only invoked in HostProcessReloadHandler#reloadInitiated L145 so it seems that currently the default value used is RestartMode.SERVERS.
# The possible "problem" could be if the user executes a reload(restartServers=false), this operation will let the HostRunningModeControl.RestartMode equals to RestartMode.HC_ONLY because it's never reverted to its default RestartMode.SERVERS after reloading the HC. The consequence I have been able to see is a minor different order when shutdown operation is executed after HC reload:

Case 1: 
/host=master:reload(restart-servers=false)
/host=master:shutdown(restart=true)

Case 2:
/host=master:reload(restart-servers=true)
/host=master:shutdown(restart=true)

Shutdown op on case 1, servers are unregistered from the HC, the HC is stopped and at the end the servers are stopped.
Shutdown op on case 2, servers are unregistered from HC, servers are stopped and at the end the HC is stopped.

Whit the change in this issue, reverting RestartMode to its default after a HC reload, the sequence of actions of shutdown operation after a reload (with restart-servers true or false) will be the same and will be the sequences on case 2.

[~brian.stansberry] About the default timeout, yes, I can confirm that it will be by default is 0 (code about timeout is in WFCORE-1427) 



was (Author: yersan):
I have arrived to these conclusions after taking a look to the code around this issue:

# It seems that the RestartMode has already a default value, created in the constructor of HostRunningModeControl. It's initialized to RestartMode.SERVERS in a single point: HostControllerEnvironment L298. Its setter is only invoked in HostProcessReloadHandler#reloadInitiated L145 so it seems that currently the default value used is RestartMode.SERVERS.
# The possible "problem" could be if the user executes a reload(restartServers=false), this operation will let the HostRunningModeControl.RestartMode equals to RestartMode.HC_ONLY because it's never reverted to its default RestartMode.SERVERS after reloading the HC. The consequence I has been able to see is a minor different order when shutdown operation is executed after HC reload:

Case 1: 
/host=master:reload(restart-servers=false)
/host=master:shutdown(restart=true)

Case 2:
/host=master:reload(restart-servers=true)
/host=master:shutdown(restart=true)

Shutdown op on case 1, servers are unregistered from the HC, the HC is stopped and at the end the server are stopped.
Shutdown op on case 2, servers are unregistered from HC, servers are stopped and at the end the HC is stopped.

Whit the change in this issue, reverting RestartMode to its default after a HC reload, the sequence of actions of shutdown operation after a reload (with restart-servers true or false) will be the same and will be the sequences on case 2.

[~brian.stansberry] About the default timeout, yes, I can confirm that it will be by default is 0 (code about timeout is in WFCORE-1427) 


> HostProcessReloadHandler does not reset the HostRunningModeControl's restartMode
> --------------------------------------------------------------------------------
>
>                 Key: WFCORE-1715
>                 URL: https://issues.jboss.org/browse/WFCORE-1715
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Domain Management
>    Affects Versions: 2.2.0.Final, 3.0.0.Alpha5
>            Reporter: Yeray Santana Borges
>            Assignee: Yeray Santana Borges
>             Fix For: 3.0.0.Alpha6
>
>
> The ReloadContext created by HostProcessReloadHandler sets the HostRunningModeControl's restartMode but then it never gets restored to the default value. The doReload() method of the ReloadContext should restore it. This ensures the ServerInventoryService.stop() only uses the value set by HostProcessReloadHandler once, for that one reload.
> A concern here is that ServerInventoryService only goes into its "shutdownServers" logic if the restartMode == RestartMode.SERVERS. Which, due to this bug, it will be following any HC reload. But if we restore the default value of restartMode, that is null, and null != RestartMode.SERVERS. So the ""shutdownServers" logic will no longer kick in. But should it? Should the default value of restartMode be "null"? Or should it be RestartMode.SERVERS? If we change the default from null, then the behavior when no reload has happened will change.
> Basically we need to decide whether the "shutdownServers" logic should happen by default.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list