Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10463

Weak affinity set up by EJB client 4 is not followed with invocations running against stateful bean deploment on WildFly 13

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 13.0.0.Final
    • 13.0.0.Beta1
    • Clustering, EJB
    • None
    • Hide

      1. Setup a pair of WildFly 13 beta servers with required user and standalone-ha.xml configuration:

      ./node1/bin/add-user.sh -a -g users -u joe -p joeIsAwesome2013!
      ./node1/bin/standalone.sh -c standalone-ha.xml -b 127.0.0.1 -bmanagement 127.0.0.1 -Djboss.node.name=node1
      ./node2/bin/add-user.sh -a -g users -u joe -p joeIsAwesome2013!
      ./node2/bin/standalone.sh -c standalone-ha.xml -b 127.0.0.2 -bmanagement 127.0.0.2 -bprivate 127.0.0.2 -Djboss.socket.binding.port-offset=100 -Djboss.node.name=node2

      2. Deploy project in repro.zip according to its readme file.
      3. Start the remote EJB client according to the readme file. Notice that the EJB client is not following the weak affinity configured in its InitialContext.

      Show
      1. Setup a pair of WildFly 13 beta servers with required user and standalone-ha.xml configuration: ./node1/bin/add-user.sh -a -g users -u joe -p joeIsAwesome2013! ./node1/bin/standalone.sh -c standalone-ha.xml -b 127.0.0.1 -bmanagement 127.0.0.1 -Djboss.node.name=node1 ./node2/bin/add-user.sh -a -g users -u joe -p joeIsAwesome2013! ./node2/bin/standalone.sh -c standalone-ha.xml -b 127.0.0.2 -bmanagement 127.0.0.2 -bprivate 127.0.0.2 -Djboss.socket.binding.port-offset=100 -Djboss.node.name=node2 2. Deploy project in repro.zip according to its readme file. 3. Start the remote EJB client according to the readme file. Notice that the EJB client is not following the weak affinity configured in its InitialContext .
    • Regression

    Description

      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.

      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");
      
      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
      

      Attachments

        Activity

          People

            pferraro@redhat.com Paul Ferraro
            mjurc@redhat.com Michal Jurc
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: