<font size=2 face="sans-serif">Hello. <br>
<br>
We have a problem from a race condition in HttpContextLifecycle.requestInitialized()</font>
<br>
<br><font size=2 face="sans-serif">The condition is as follows: </font>
<br>
<br><font size=2 face="sans-serif">Thread one calls </font><font size=2 face="Monospace">nestedInvocationGuard.set(</font><font size=2 color=#820040 face="Monospace"><b>new</b></font><font size=2 face="Monospace">
Counter());</font>
<br><font size=2 face="sans-serif">Thread two calls </font><font size=2 face="Monospace">Counter
counter = nestedInvocationGuard.get(); &nbsp;Object marker = request.getAttribute(GUARD_PARAMETER_NAME);</font>
<br><font size=2 face="Monospace">Thread one has not yet called request.setAttribute(GUARD_PARAMETER_NAME,
GUARD_PARAMETER_VALUE);</font>
<br>
<br><font size=2 face="Monospace">This will result in thread two having
a counter but no marker, leading to ServletLogger.LOG.guardLeak(counter.value);</font>
<br>
<br><font size=2 face="Monospace">I believe this issue is known because
of the following comment. </font>
<br>
<br><font size=2 color=#3f8080 face="Monospace">* This request has not
been processed yet but the guard is set already. That indicates, that the
guard leaked from a previous request</font>
<br><font size=2 color=#3f8080 face="Monospace">* processing - most likely
the Servlet container did not invoke listener methods symmetrically. Log
a warning and recover by</font>
<br><font size=2 color=#3f8080 face="Monospace">* re-initializing the guard</font>
<br>
<br><font size=2 face="Monospace">I am assuming that &quot;symmetrically&quot;
is supposed to say &quot;synchronised&quot;. </font>
<br>
<br><font size=2 face="Monospace">I have checked with the relevant team
and there is no way we can call that method from inside a synchronised
block. So I was hoping that you might have some alternatives? <br>
<br>
I noticed that the file at </font><a href="https://github.com/doctau/weld-core/blob/master/impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java"><font size=2 face="Monospace">https://github.com/doctau/weld-core/blob/master/impl/src/main/java/org/jboss/weld/servlet/HttpContextLifecycle.java</font></a><font size=2 face="Monospace">
has been updated and no longer has that race condition? Do you think including
that update resolve this issue? And if so which release will include that
update. <br>
<br>
Regards</font>
<br><font size=2 face="Monospace">Benjamin</font><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>