[jboss-jira] [JBoss JIRA] (WFCORE-1467) Servers are suspended two times using timeout parameter in domain mode

James Perkins (JIRA) issues at jboss.org
Wed Apr 6 20:38:00 EDT 2016


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

James Perkins edited comment on WFCORE-1467 at 4/6/16 8:37 PM:
---------------------------------------------------------------

The issue with the timeout being doubled is because {{DomainServerLifecycleHandlers.SuspendServersLifecycleHandler}} calculates the millis and passes to the {{ServerInventory.awaitServerSuspend()}} (which delegates to the [{{ManagedServer.awaitSuspend()}}|https://github.com/wildfly/wildfly-core/blob/2.1.0.Final/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java#L711-L730]) which executes {{suspend}} again with the timeout which is once again calculated on the suspend operation.

This is the same reason we see the suspend twice actually. It happens first for [each server|https://github.com/wildfly/wildfly-core/blob/2.1.0.Final/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java#L672-L689] then happens again in the {{ServerInventory.awaitServerSuspend()}} for each server.
{code:java}
for (String serverName : processes.keySet()) {
    final String serverModelName = serverInventory.getProcessServerName(serverName);
    if (group == null || serversInGroup.contains(serverModelName)) {
        serverInventory.suspendServer(serverModelName);
        waitForServers.add(serverModelName);
    }
}
if (timeout != 0) {
    serverInventory.awaitServerSuspend(waitForServers, timeout > 0 ? timeout * 1000 : timeout);
}
{code}

The double timeout is easy to fix. The actual suspend operation I'm not so sure what the correct approach is. [~brian.stansberry] what do you think?


was (Author: jamezp):
The issue with the timeout being doubled is because {{DomainServerLifecycleHandlers.SuspendServersLifecycleHandler}} calculates the millis and passes to the [{{ServerInventory.awaitServerSuspend()}}|https://github.com/wildfly/wildfly-core/blob/2.1.0.Final/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java#L711-L730] which executes {{suspend}} again with the timeout which is once again calculated on the suspend operation.

This is the same reason we see the suspend twice actually. It happens first for [each server|https://github.com/wildfly/wildfly-core/blob/2.1.0.Final/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServer.java#L672-L689] then happens again in the {{ServerInventory.awaitServerSuspend()}}.
{code:java}
for (String serverName : processes.keySet()) {
    final String serverModelName = serverInventory.getProcessServerName(serverName);
    if (group == null || serversInGroup.contains(serverModelName)) {
        serverInventory.suspendServer(serverModelName);
        waitForServers.add(serverModelName);
    }
}
if (timeout != 0) {
    serverInventory.awaitServerSuspend(waitForServers, timeout > 0 ? timeout * 1000 : timeout);
}
{code}

The double timeout is easy to fix. The actual suspend operation I'm not so sure what the correct approach is. [~brian.stansberry] what do you think?

> Servers are suspended two times using timeout parameter in domain mode
> ----------------------------------------------------------------------
>
>                 Key: WFCORE-1467
>                 URL: https://issues.jboss.org/browse/WFCORE-1467
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: Domain Management
>            Reporter: Yeray Santana Borges
>            Assignee: Yeray Santana Borges
>
> In a domain mode :suspend-servers command with a timeout parameter different than 0 executes two suspend operations for each server in the domain. It first executes a suspend with 0ms and later a suspend with the timeout specified.
> How to reproduce it:
> {code}
> [domain at localhost:9990 /] :suspend-servers(timeout=10)
> {code}
> Server log traces show:
> {code}
> [Server:server-one] 20:14:40,126 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 8) WFLYSRV0211: Suspending server with 0ms timeout.
> [Server:server-one] 20:14:40,135 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 8) WFLYSRV0211: Suspending server with 10000000ms timeout.
> {code}
> Expected traces are:
> {code}
> [Server:server-one] 20:14:40,135 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 8) WFLYSRV0211: Suspending server with 10000000ms timeout.
> {code}



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


More information about the jboss-jira mailing list