[wildfly-dev] "Boot time" system props in the managed server's model

Brian Stansberry brian.stansberry at redhat.com
Thu Feb 5 12:46:43 EST 2015


On 2/5/15 11:33 AM, Jason Greene wrote:
>
>> On Feb 5, 2015, at 11:24 AM, Brian Stansberry <brian.stansberry at redhat.com> wrote:
>>
>> On 2/5/15 11:13 AM, Kabir Khan wrote:
>>>
>>>> On 5 Feb 2015, at 16:39, Brian Stansberry <brian.stansberry at redhat.com> wrote:
>>>>
>>>> tl;dr
>>>>
>>>> We have a minor anomaly in system property processing in domain mode
>>>> that we intend to ignore.
>>>>
>>>> long version
>>>>
>>>> While digging into a bug Emmanuel Hugonnet noticed an anomaly. When you
>>>> define a system-property resource in domain.xml or host.xml with
>>>> "boot-time=true", the HC does both of the following when it launches a
>>>> server:
>>>>
>>>> 1) Uses -D to set the prop when it starts the server process.
>>>>
>>>> 2) Adds an add system-property op to the server's set of boot ops, which
>>>> causes the system property to get set again later during boot.
>>>>
>>>> Really, only 1) should happen; that's what "boot-time=true" means. The
>>>> purpose of boot-time=true is to ensure the value is set at JVM launch,
>>>> not waiting for management ops to execute, which may be too late for
>>>> props that are read early.
>>> I am not 100% convinced.
>>
>> Me neither. :)
>>
>> 1) should of course happen. But it could be argued that something in the
>> domain management model should always be reflected in the resulting
>> server management model. It feels a bit weird to make random exceptions.
>>
>> It's similar to a jvm setting. It's a configuration of how the HC behaves.
>
> If I understand correctly, the add op generated on all servers sets a system property, which activates at runtime correct?
>

Yes, but the property has already been set, via -D when the process was 
started. So it's redundant.

> If so I actually think the behavior is arguably correct, if a bit odd.
>

I don't see this part as much of a problem; it's just odd.

The problem is more the part you cut: when a prop gets added to the 
domain model after a server is running. Say in the CLI:

/system-property=java.net.preferIPv4Address:add(value=true,boot-time=true)

Domain level scope; applicable to all servers. All servers will end up 
getting this op as part of domain rollout of the change:

/system-property=java.net.preferIPv4Address:add(value=true)

Now those server JVMs will have java.net.preferIPv4Address=true

But their actual running behavior will not reflect this. The VM reads 
that prop early and doesn't read it again. You need to set it at VM 
launch for it to take proper effect, which is why we have the 
boot-time=true attribute in the first place.

At this point the server's runtime state is out of sync with the domain 
configuration, but we don't reflect that by putting the server in 
restart-required.

> --
> Jason T. Greene
> WildFly Lead / JBoss EAP Platform Architect
> JBoss, a division of Red Hat
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list