<div dir="ltr"><div><div><div><div><div>You are adding and starting this service in performBoottime which is causing you this issues.<br></div>As you service can get started before stage MODEL can complete<br><br></div>I would change initial state of the service to ON_DEMAND instead of active.<br><a href="https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystemAdd.java#L432">https://github.com/wildfly/wildfly/blob/master/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystemAdd.java#L432</a><br><br></div>which should solve your problem. I would do the same also for <span class="gmail-pl-smi">JTAEnvironmentBeanService.<br><br></span></div><span class="gmail-pl-smi">so they get started only when needed not up front without any requirement.<br><br>--<br></span></div><span class="gmail-pl-smi">tomaz<br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 12, 2016 at 9:50 PM, Tom Jenkinson <span dir="ltr">&lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks for the input/<div><br>This is the point I do not think the property has been set by:</div><div><br></div><div><div>&quot;MSC service thread 1-3@2595&quot; prio=5 tid=0x14 nid=NA runnable</div><div>  java.lang.Thread.State: RUNNABLE</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.ats.arjuna.common.<wbr>RecoveryEnvironmentBean.<wbr>getExpiryScannerClassNames(<wbr>RecoveryEnvironmentBean.java:<wbr>336)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  - locked &lt;0x1bb6&gt; (a com.arjuna.ats.arjuna.common.<wbr>RecoveryEnvironmentBean)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at sun.reflect.<wbr>NativeMethodAccessorImpl.<wbr>invoke0(<wbr>NativeMethodAccessorImpl.java:<wbr>-1)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at sun.reflect.<wbr>NativeMethodAccessorImpl.<wbr>invoke(<wbr>NativeMethodAccessorImpl.java:<wbr>62)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at sun.reflect.<wbr>DelegatingMethodAccessorImpl.<wbr>invoke(<wbr>DelegatingMethodAccessorImpl.<wbr>java:43)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at java.lang.reflect.Method.<wbr>invoke(Method.java:498)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.common.internal.<wbr>util.propertyservice.<wbr>BeanPopulator.<wbr>handleGroupProperty(<wbr>BeanPopulator.java:263)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.common.internal.<wbr>util.propertyservice.<wbr>BeanPopulator.<wbr>configureFromProperties(<wbr>BeanPopulator.java:170)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.common.internal.<wbr>util.propertyservice.<wbr>BeanPopulator.<wbr>getNamedInstance(<wbr>BeanPopulator.java:87)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.common.internal.<wbr>util.propertyservice.<wbr>BeanPopulator.<wbr>getDefaultInstance(<wbr>BeanPopulator.java:53)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at com.arjuna.ats.arjuna.common.<wbr>recoveryPropertyManager.<wbr>getRecoveryEnvironmentBean(<wbr>recoveryPropertyManager.java:<wbr>34)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at org.jboss.as.txn.service.<wbr>ArjunaRecoveryManagerService.<wbr>start(<wbr>ArjunaRecoveryManagerService.<wbr>java:96)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  - locked &lt;0x1bd2&gt; (a org.jboss.as.txn.service.<wbr>ArjunaRecoveryManagerService)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at org.jboss.msc.service.<wbr>ServiceControllerImpl$<wbr>StartTask.startService(<wbr>ServiceControllerImpl.java:<wbr>1963)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at org.jboss.msc.service.<wbr>ServiceControllerImpl$<wbr>StartTask.run(<wbr>ServiceControllerImpl.java:<wbr>1896)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at java.util.concurrent.<wbr>ThreadPoolExecutor.runWorker(<wbr>ThreadPoolExecutor.java:1142)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at java.util.concurrent.<wbr>ThreadPoolExecutor$Worker.run(<wbr>ThreadPoolExecutor.java:617)</div><div><span class="m_3062480663474458781gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>  at java.lang.Thread.run(Thread.<wbr>java:745)</div></div><div><br></div><div>(that is output from the debugger)</div><div><br></div><div>Once releasing that thread and letting the container continue startup I see this execute:</div><div><div>2016-12-12 20:46:49,731 TRACE [org.jboss.as.controller.<wbr>management-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.server.<wbr>operations.<wbr>SystemPropertyAddHandler@<wbr>5c7e7735 handling add in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.<wbr>expiryScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}</div><div>2016-12-12 20:46:49,787 TRACE [org.jboss.as.controller.<wbr>management-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.controller.<wbr>ValidateModelStepHandler@<wbr>f15c8f7 handling internal-model-validation in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.<wbr>expiryScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}</div></div><div><br></div><div>I believe this is different to previous behaviour as I have had a defect raised against TX: <a href="https://issues.jboss.org/browse/JBEAP-7820" target="_blank">https://issues.jboss.org/<wbr>browse/JBEAP-7820</a>. It&#39;s possible that there is a regression in Narayana (somehow) if nothing changed in this area in the core itself.</div><div><br></div><div>Thanks for your input,</div><div>Tom</div><div><br></div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 12 December 2016 at 20:15, Brian Stansberry <span dir="ltr">&lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This works fine for me. Adding that xml snippet to standalone.xml after the &lt;extensions&gt; element I see the property being set during boot before any processing of subsystem operations begins.<br>
<div class="m_3062480663474458781HOEnZb"><div class="m_3062480663474458781h5"><br>
&gt; On Dec 12, 2016, at 1:55 PM, Brian Stansberry &lt;<a href="mailto:brian.stansberry@redhat.com" target="_blank">brian.stansberry@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; I don’t see anything in the organization of boot ops that would have changed the ordering, and the add op for that system property should be executing prior to the subsystem ops. I’ll see if I can reproduce.<br>
&gt;<br>
&gt;&gt; On Dec 12, 2016, at 12:10 PM, Kabir Khan &lt;<a href="mailto:kabir.khan@jboss.com" target="_blank">kabir.khan@jboss.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Where are you trying to use the system property from? They should only be attempted resolved during the RUNTIME stage, not MODEL.<br>
&gt;&gt;&gt; On 12 Dec 2016, at 18:00, Tom Jenkinson &lt;<a href="mailto:tom.jenkinson@redhat.com" target="_blank">tom.jenkinson@redhat.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I have a subsystem that configures itself from system properties.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; For example:<br>
&gt;&gt;&gt; &lt;system-properties&gt;<br>
&gt;&gt;&gt; &lt;property name=&quot;RecoveryEnvironmentBean.<wbr>expiryScannerClassNames&quot; value=&quot;com.arjuna.ats.internal<wbr>.arjuna.recovery.ExpiredTransa<wbr>ctionStatusManagerScanner com.arjuna.ats.internal.arjuna<wbr>.recovery.AtomicActionExpirySc<wbr>anner&quot;/&gt;<br>
&gt;&gt;&gt; &lt;/system-properties&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; In earlier revisions of WFLY this worked fine. However I am now seeing that the system property is not set until after my subsystem has started. I can tell this as I have breakpoints on where I process the property. I can see &quot;MSC service thread 1-4&quot; attempting to process the property (which is not set). I do later see messages that suggest the system property is set but at that the later point:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2016-12-12 17:57:48,042 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.server.operations<wbr>.SystemPropertyAddHandler@784c<wbr>8c5f handling add in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt;&gt; 2016-12-12 17:57:48,093 TRACE [org.jboss.as.controller.manag<wbr>ement-operation] (Controller Boot Thread) Final response for step handler org.jboss.as.controller.Valida<wbr>teModelStepHandler@87b4493 handling internal-model-validation in address [(&quot;system-property&quot; =&gt; &quot;RecoveryEnvironmentBean.expir<wbr>yScannerClassNames&quot;)] is {&quot;outcome&quot; =&gt; &quot;success&quot;}<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Does my subsystem need to depend on something to get the old behaviour of being started after system properties are processed?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; My subsystem is the transaction one and the service is the recovery manager.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt; Tom<br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; wildfly-dev mailing list<br>
&gt;&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
&gt;<br>
&gt; --<br>
&gt; Brian Stansberry<br>
&gt; Manager, Senior Principal Software Engineer<br>
&gt; JBoss by Red Hat<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; wildfly-dev mailing list<br>
&gt; <a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a><br>
<br>
--<br>
Brian Stansberry<br>
Manager, Senior Principal Software Engineer<br>
JBoss by Red Hat<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org" target="_blank">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailma<wbr>n/listinfo/wildfly-dev</a></div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/wildfly-dev</a><br></blockquote></div><br></div>