]
Paul Ferraro commented on WFLY-10463:
-------------------------------------
[~mjurc] I have not yet run your reproducer, but wanted to clarify some misunderstandings
about the expected behavior first. Setting the affinity for a @Stateful EJB should
control on which node the EJB is initially created. However, the server may update the
client at any time with a new weak affinity if the primary ownership of the given EJB
changes, in response to a deploy/undeploy of the application containing the EJB on any
node in the associated cluster. This has been the behavior ever since WF8.
Weak affinity set up by EJB client 4 is not followed with invocations
running against stateful bean deploment on WildFly 13
---------------------------------------------------------------------------------------------------------------------------
Key: WFLY-10463
URL:
https://issues.jboss.org/browse/WFLY-10463
Project: WildFly
Issue Type: Bug
Components: Clustering, EJB
Affects Versions: 13.0.0.Beta1
Environment: WildFly 13 beta runtimes. EJB client version does not matter (tested
with {{org.wildfly:wildfly-ejb-client-bom:12.0.0.Final}}).
Reporter: Michal Jurc
Assignee: Paul Ferraro
Priority: Blocker
Attachments: repro.zip
Remote EJB client with {{InitialContext}} setting up weak affinity will not hold up the
affinity, resulting in a behaviour that's different to previous releases of WildFly.
In previous versions of WildFly, {{java.naming.provider.url}} property of
{{InitialContext}} was enough to enforce weak affinity to a node in remote EJB client.
This is a regression compared to WildFly 12. The client version does not change the
behaviour, which leads me to believe the issue is server-side.
Update: The issue affects only stateful bean invocations.
{code}
while (true) {
try {
final Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
WildFlyInitialContextFactory.class.getName());
props.put(Context.PROVIDER_URL,
"remote+http://127.0.0.1:8080");
final InitialContext ejbCtx = new InitialContext(props);
final HelloBeanRemote bean = (HelloBeanRemote) ejbCtx
.lookup("ejb:/server/HelloBean!" +
HelloBeanRemote.class.getName() + "?stateful");
for (int i = 0; i < 10; i++) {
System.out.println(bean.hello());
}
} catch(Exception e) {
System.out.println("Call failed!!!!");
e.printStackTrace();
}
final Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
WildFlyInitialContextFactory.class.getName());
props.put(Context.PROVIDER_URL, "remote+http://127.0.0.1:8080");
{code}
{code}11:56:02,452 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling
invoke(module = /server/HelloBean, strong affinity = Cluster "ejb", weak
affinity = Node "node1"):
node1, 0
11:56:02,460 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 1
11:56:02,465 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 2
11:56:02,472 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 3
11:56:02,477 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 4
11:56:02,488 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 5
11:56:02,496 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 6
11:56:02,502 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 7
11:56:02,507 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 8
11:56:02,515 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node1"):
node1, 9
11:56:03,535 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 0
11:56:03,544 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 1
11:56:03,555 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 2
11:56:03,561 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 3
11:56:03,568 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 4
11:56:03,586 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 5
11:56:03,595 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 6
11:56:03,602 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 7
11:56:03,616 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 8
11:56:03,628 DEBUG [org.jboss.ejb.client.EJBInvocationHandler:164] Calling invoke(module
= /server/HelloBean, strong affinity = Cluster "ejb", weak affinity = Node
"node2"):
node2, 9
{code}