[jboss-jira] [JBoss JIRA] (WFLY-10463) Weak affinity set up by EJB client 4 is not followed with invocations running against WildFly 13

Radoslav Husar (JIRA) issues at jboss.org
Mon May 28 08:03:01 EDT 2018


    [ https://issues.jboss.org/browse/WFLY-10463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582833#comment-13582833 ] 

Radoslav Husar commented on WFLY-10463:
---------------------------------------

This issue seems to me like misunderstanding of affinity. Affinity pertains to the proxy, not the client. Thus {{Context.PROVIDER_URL}} (1) has nothing to do with enforcing affinity (though in many cases it will be the same node, e.g. single node deployment). The API to set weak affinity is {{org.jboss.ejb.client.EJBClient#setWeakAffinity}}.

Regardless of that, if any of this turns out to be a bug, certainly not a blocker.

(1) https://docs.oracle.com/javase/7/docs/api/javax/naming/Context.html#PROVIDER_URL

> Weak affinity set up by EJB client 4 is not followed with invocations running against 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.
> {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