[
https://issues.jboss.org/browse/WFLY-10607?page=com.atlassian.jira.plugin...
]
Richard Achmatowicz commented on WFLY-10607:
--------------------------------------------
(from an older post on a related issue)
I'm looking at this issue at the moment. The issue centers around the operation of the
StatefulComponentInstanceInterceptor and the StatefulSessionSynchronizationInterceptor
which work together to manage the following: when a method invocation is processed at the
server, lookup bean instances from the cache and attach them to the invocation, release
those bean instances back to the cache when the invocation has finished, and manage
registration of transaction synchronizations if the method is in the scope of a container
managed transaction. Actually, a lot more goes on, but its not worth going into in detail.
For example, over and above the managed transaction, we have an Infinispan transaction
associated with operations get()/put() on the cache which involve the InfinispanBatcher.
The "not in valid state" issue arises when the forwarding node tries to make an
invocation on a remote bean and the bean is not found (i.e. NoSuchEJBException is returned
as a result of the invocation). What happens here is this: the synchronization interceptor
unconditionally calls release() in its finally clause to decrement the usage count of the
bean instance which was looked up by the instance interceptor. Under the right conditions,
this will case a commit of the Infinispan transaction. Later on, the instance interceptor
handles the NoSuchEJBException on the method return by attempting to call discard() on the
same bean instance within the same Infinispan transaction ; this fails because the
Infinispan transaction has already been committed by the synchronization interceptor.
The fix here is to modify the code in the synchronization interceptor to check if the
method invocation return is an exception and if so, do not call release() in that case -
we don't want to commit work that is associated with (bad) exceptions. When this is
done, the instance interceptor can now successfully call discard() and the problem is
resolved.
However, with this fixed, the test still fails with a NoSuchEJBException, which should not
happen as there is a live node available in the cluster the forwarding node is sending the
invocation to. I'm starting to look into that now.
Fix intermittent failures in RemoteEJBForwardingTestCases
---------------------------------------------------------
Key: WFLY-10607
URL:
https://issues.jboss.org/browse/WFLY-10607
Project: WildFly
Issue Type: Bug
Components: EJB, Test Suite
Reporter: Petr Kremensky
Assignee: Richard Achmatowicz
The tests were ignored by
https://github.com/wildfly/wildfly/pull/10563/files
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)