Bug 990274 - server jvm settings take effect only after host controller restart
server jvm settings take effect only after host controller restart
Status: VERIFIED
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management (Show other bugs)
6.1.1
Unspecified Unspecified
unspecified Severity low
: DR6
: EAP 6.4.0
Assigned To: Kabir Khan
Petr Kremensky
Russell Dickenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-30 14:37 EDT by Aleksandar Kostadinov
Modified: 2015-02-01 18:06 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFCORE-165 Major Resolved Server jvm settings take effect only after host controller restart 2015-11-02 04:58 EST

  None (edit)
Description Aleksandar Kostadinov 2013-07-30 14:37:11 EDT
Changing server JVM settings takes effect only after host controller restart. I was trying to run the servers on a 32bit machine and server was unable to start with default memory settings.
I changed JVM settings through domain master admin console. Server failed to start until I restarted host controller of the 32bit machine.
Comment 1 Aleksandar Kostadinov 2013-07-30 14:42:22 EDT
btw I'm not sure if this would qualify as a bug but I don't see domain server being able to start with default settings on a 32bit machine.
Comment 3 Kabir Khan 2014-07-21 13:16:58 EDT
I have tried this upstream with the following setup. Server with small heap settings:
        <server name="server-one" group="main-server-group">
            <jvm name="default">
                <heap size="64m" max-size="256m"/>
                <permgen size="256m" max-size="256m"/>
                <jvm-options>
                    <option value="-server"/>
                </jvm-options>
            </jvm>
        </server>

It fails to start. Then in CLI change the minimum heap size:
[standalone@localhost:9990 /] /host=master/server-config=server-one:stop
{
    "outcome" => "success",
    "result" => "STOPPING"
}
[standalone@localhost:9990 /] /host=master/server-config=server-one/jvm=default:write-attribute(name=heap-size,value=64m)
{
    "outcome" => "success",
    "result" => undefined,
    "server-groups" => undefined
}
[standalone@localhost:9990 /] /host=master/server-config=server-one:start
{
    "outcome" => "success",
    "result" => "FAILED"
}
Then in CLI change the maximum heap size:
[standalone@localhost:9990 /] /host=master/server-config=server-one:stop
{
    "outcome" => "success",
    "result" => "STOPPING"
}
[standalone@localhost:9990 /] /host=master/server-config=server-one/jvm=default:write-attribute(name=max-heap-size,value=256m)
{
    "outcome" => "success",
    "result" => undefined,
    "server-groups" => undefined
}
[standalone@localhost:9990 /] /host=master/server-config=server-one:start
{
    "outcome" => "success",
    "result" => "STARTING"
}
The server gets started upstream, and I see the JVM options get recalculated in my debugger each time I call start(). I'll look at the current EAP 6.3 branch next.
Comment 4 Kabir Khan 2014-07-21 13:28:00 EDT
                <heap size="64m" max-size="256m"/>
in my initial post should read
                <heap size="64k" max-size="256k"/>
Comment 5 Kabir Khan 2014-07-21 14:46:20 EDT
I tried the same settings in EAP 6.3.0. From the CLI, the same sequence of commands work, however from the console I see the behaviour mentioned below.

The initial error on startup is:
18:34:57,228 INFO  [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 3) JBAS012017: Starting process 'Server:server-one'
[Server:server-one] Error occurred during initialization of VM
[Server:server-one] Too small initial heap
18:34:57,253 INFO  [org.jboss.as.process.Server:server-one.status] (reaper for Server:server-one) JBAS012010: Process 'Server:server-one' finished with an exit status of 1


I then change the 'Heap Size' for server-one in the Domain Server Configurations. 
Then I try to start the server under Runtime, and the logs report:
[Host Controller] 18:36:03,515 INFO  [org.jboss.as.host.controller] (HttpManagementService-threads - 2) JBAS010922: Starting server server-one
18:36:03,517 INFO  [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 5) JBAS012017: Starting process 'Server:server-one'
[Server:server-one] Error occurred during initialization of VM
[Server:server-one] Too small initial heap
18:36:03,536 INFO  [org.jboss.as.process.Server:server-one.status] (reaper for Server:server-one) JBAS012010: Process 'Server:server-one' finished with an exit status of 1
[Host Controller] 18:36:03,538 INFO  [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) JBAS010926: Unregistering server server-one

I then change the 'Max Heap Size' in the Domain Server Configurations. Again I try to start the server under Runtime, and I get the same log as in my previous attempt.

At this stage, I see the correct values in the model. If I try to do the same to the server without stopping it first, e.g starting from scratch with max-heap-size=256k:
[domain@localhost:9999 /] /host=master/server-config=server-one/jvm=default:write-attribute(name=max-heap-size,value=256m)
{
    "outcome" => "success",
    "result" => undefined,
    "server-groups" => undefined
}
[domain@localhost:9999 /] /host=master/server-config=server-one:restart
{
    "outcome" => "failed",
    "failure-description" => "JBAS010946: Cannot restart server server-one as it is not currently started; it is FAILED",
    "rolled-back" => true
}
The restart problem appears to be in ServerRestartHandler, checking that the state is STARTED.

[domain@localhost:9999 /] /host=master/server-config=server-one:start
{
    "outcome" => "success",
    "result" => "FAILED"
}

The start problem gives the same log output as above, and appears to be something in the state machine of ManagedServer.
Comment 6 Kabir Khan 2014-10-15 07:26:48 EDT
https://github.com/jbossas/jboss-eap/pull/1812
Comment 7 Petr Kremensky 2014-10-24 04:15:41 EDT
And what about restart operation?

# Start domain and run
/host=master/server-config=server-one/jvm=default:add
/host=master/server-config=server-one/jvm=default:write-attribute(name=heap-size,value=64k)
/host=master/server-config=server-one/jvm=default:write-attribute(name=max-heap-size,value=256k)
/host=master:reload
/host=master/server-config=server-one/jvm=default:write-attribute(name=heap-size,value=64m)
/host=master/server-config=server-one/jvm=default:write-attribute(name=max-heap-size,value=256m)

case 1) 
 /host=master/server-config=server-one:start 
 -> server-one is started
case 2)
 /host=master/server-config=server-one:stop
 /host=master/server-config=server-one:start
 -> server-one is started
case 3) 
 /host=master/server-config=server-one:restart
{
    "outcome" => "failed",
    "failure-description" => "JBAS010946: Cannot restart server server-one as it is not currently started; it is FAILED",
    "rolled-back" => true
}
Comment 8 JBoss JIRA Server 2014-11-04 05:41:38 EST
Kabir Khan <kabir.khan@jboss.com> updated the status of jira WFCORE-165 to Resolved
Comment 9 Petr Kremensky 2014-11-06 01:46:00 EST
I'll answer my own question :). According to the operation description server has to be in running state to be able to use restart operation thus behaviour I described in comment 7 is correct.

Verified on EAP 6.4.0.DR8.

Note You need to log in before you can comment on or make changes to this bug.