[
https://issues.jboss.org/browse/WFLY-11833?page=com.atlassian.jira.plugin...
]
Richard Achmatowicz edited comment on WFLY-11833 at 7/23/19 9:59 AM:
---------------------------------------------------------------------
To further clarify what is going on here, let's differentiate between the calling
proxy affinity and the result proxy affinity. In this example, a client makes a remote
invocation on a server using its calling proxy. The server, in the process of processing
the invocation, creates a SFSB on the server, and returns a proxy for that SFSB back to
the caller. This is the result proxy. During this single invocation, both the caller proxy
and the result proxy will have their affinities adjusted.
The adjustment to the caller proxy is made using the information gathered by invocation
interceptors, the affinity parameters passed to the server, and the affinity changes
returned from the server. The final adjustments are made in
EJBClientInvocationContext.getResult() when the final settings for strong affinity and
weak affinity are established. The purpose of this affinity adjustment is for correctly
managing the behavior of SLSB load balancing and SFSB fail-over, both of which depend on
affinities to constrain choice of the correct target node, and which is largely determined
by the type of bean the proxy represents and where the last invocation successfully
executed.
Th adjustment to result proxy is made during the marshaling and un-marshaling of the
result from the server back to the client. Here, writeReplace() and readResiove() in the
ObjectResolver for the Marshaller are used to replace the original affinity defined in the
created proxy from Affinity.LOCAL to something else, where that something else depends
only on the connection endpoints between client and server, as mentioned above.
It's important to keep these two aspects separated, as things can otherwise get very
confusing.
was (Author: rachmato):
To further clarify what is going on here, let's differentiate between the calling
proxy affinity and the result proxy affinity. In this example, a client makes a remote
invocation on a server using its calling proxy. The server, in the process of processing
the invocation, creates a SFSB on the server, and returns a proxy for that SFSB back to
the caller. This is the result proxy. During this single invocation, both the caller proxy
and the result proxy will have their affinities adjusted.
The adjustment to the caller proxy is made using the information gathered by invocation
interceptors, the affinity parameters passed to the server, and the affinity changes
returned from the server. The final adjustments are made in
EJBClientInvocationContext.getResult() when the final settings for strong affinity and
weak affinity are established. The purpose of this affinity adjustment is for correctly
managing the behavior of SLSB load balancing and SFSB fail-over, both of which depend on
affinities to constrain choice of the correct target node.
Th adjustment to result proxy is made during the marshaling and un-marshaling of the
result from the server back to the client. Here, writeReplace() and readResiove() are used
to replace the original affinity defined in the created proxy from Affinity.LOCAL to
something else, where that something else depends only on the connection endpoints between
client and server, as mentioned above.
It's important to keep these two aspects separated.
Stateful Session Bean affinity URI instead of cluster
-----------------------------------------------------
Key: WFLY-11833
URL:
https://issues.jboss.org/browse/WFLY-11833
Project: WildFly
Issue Type: Bug
Components: Clustering, EJB
Affects Versions: 16.0.0.Final
Environment: WildFly cluster having SFSB deployed.
Reporter: Joerg Baesner
Assignee: Richard Achmatowicz
Priority: Major
Labels: downstream_dependency
Attachments: stateful-timeout.zip, test-debug-log.txt
Deployed is an application with the following setup:
* Containing a SFSB (_with passivationCapable="true"_)
* A SLSB exposing a _remote_ method to a standalone client returning an instance of the
SFSB
Scenario:
A standalone client is invoking the _remote_ method on the Stateless Session Bean and a
new instance of the Stateful Session Bean is returned.
The issue is that the affinity of the returned Stateful Session Bean is URI instead of
Cluster.
See the attached Gradle reproducer application
--
This message was sent by Atlassian Jira
(v7.12.1#712002)