[jboss-jira] [JBoss JIRA] (WFLY-10463) Weak affinity set up by EJB client 4 is not followed with invocations running against stateful bean deploment on WildFly 13
Paul Ferraro (JIRA)
issues at jboss.org
Tue May 29 10:19:02 EDT 2018
[ https://issues.jboss.org/browse/WFLY-10463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Ferraro reopened WFLY-10463:
---------------------------------
Spoke too soon. The issue isn't that the client isn't honoring the weak affinity. The problem is that the server can report an incorrect weak affinity - and the client does as it is told.
Fix on the way.
> 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}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list