Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 900638 (JBPAPP6-1391)

Summary: EJB remote client gets stuck in some cases
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ondrej Chaloupka <ochaloup>
Component: RemotingAssignee: David M. Lloyd <david.lloyd>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: atangrin, david.lloyd, dimitris, heinz.wilming, jmartisk, lthon, ochaloup
Target Milestone: ---   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBPAPP6-1391
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-20 07:47:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server-thread-dump.txt
none
client-thread-dump.txt
none
client-thread-dump-server-stuck.txt
none
server-stuck-thread-dump.txt none

Description Ondrej Chaloupka 2012-06-14 22:53:42 UTC
project_key: JBPAPP6

I was trying to investigate when and why the remote client does not connect up to the cluster. So far I found two cases when the client stops working and which are (I think at least) reproducible.

In the first case the client stops working without any exception and it was needed to kill the cliend hardly. The output seems like:
{code}
Jun 15, 2012 12:47:06 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.4.GA
Jun 15, 2012 12:47:06 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.4.GA
Jun 15, 2012 12:47:06 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.8.GA
Jun 15, 2012 12:47:07 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Jun 15, 2012 12:47:07 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@13e58d4, receiver=Remoting connection EJB receiver [connection=Remoting connection <2acc65>,channel=jboss.ejb,nodename=ibm-x365500]} on channel Channel ID e3278064 (outbound) of Remoting connection 00b9e45a to /192.168.56.102:4447
{code}
Steps to reproduce:
1) Run 2 jboss eap CR1 servers on two different machines. The client is on third one. The different machines are important because when I run two jboss servers on just one machine then all works fine.
(As well it happened to me that this problem occurs during first remote calls to server after the jboss server is started).
2) Run client that has property file similar to:
https://github.com/ochaloup/testing/blob/bee1666aa780244112d1a0312c5e2827171f87b6/myejbclient/src/jboss-ejb-client.properties.erroreous
The important is that the connection that is defined first on line:
{code}
remote.connections=two,one
{code}
has to have defined SASL_DISALLOWED_MECHANISM property like:
{code}
remote.connection.one.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER
{code}
This is a little strange that this sasl parameter has some influence on remoting client when none of the nodes is on the same machine as the client runs. Because when you remove that line with sasl from the property file than the remote client starts to work without problem.
This error occurs either when server does have remoting connector authentication switched off or when it's switched on and the passwords have to be used.
Then when the client is not killed and you want to stop server the server waits for something and is frozen as well. It never finishes in stopping itself. You need to kill the client app and then the server ends.


Run the client with the second problematic settings ends with:
{code}
Jun 14, 2012 8:29:58 PM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.10.Final
Staying before while cycle
Jun 14, 2012 8:29:58 PM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.4.GA
Jun 14, 2012 8:29:58 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.4.GA
Jun 14, 2012 8:29:58 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.8.GA
Jun 14, 2012 8:30:03 PM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector setupEJBReceivers
WARN: Could not register a EJB receiver for connection to 192.168.56.103:4447
java.lang.RuntimeException: Operation failed with status WAITING
	at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)
	at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:119)
	at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:76)
	at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:77)
	at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:120)
	at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
	at $Proxy0.sayHello(Unknown Source)
	at client.Client.main(Client.java:52)
Jun 14, 2012 8:30:03 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Jun 14, 2012 8:30:03 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@1484a05, receiver=Remoting connection EJB receiver [connection=Remoting connection <bad8a8>,channel=jboss.ejb,nodename=server3]} on channel Channel ID a09b6dff (outbound) of Remoting connection 016c163f to /192.168.56.102:4447
{code}
and the client is frozen and no action is possible to do with it (similar to the first case). 
Steps to reproduce:
1) Run two servers on different nodes. I used a command similar to this one:
{code}
./standalone.sh -c standalone-ha.xml -Djboss.node.name=node-name -Djboss.bind.address=192.168.56.101 -Djboss.bind.address.management=192.168.56.101 -Djboss.bind.address.unsecure=192.168.56.101
{code}
client is run on a third machine.
2) Run remote ejb client with like this:
{code}
https://github.com/ochaloup/testing/blob/bee1666aa780244112d1a0312c5e2827171f87b6/myejbclient/src/jboss-ejb-client.properties.erroreus2
{code}
The important is to have an third server defined but this third server does not exit (there is no connection that the client could use for connecting for that server) and plus do not specify the sasl 
property to this third definition. When you define the sasl property then it seems that the connection to the server will be established without problem.


When you follow the explanation of the steps then I hope it's reproducible. You can use for reproducing my testing app on:
https://github.com/ochaloup/testing/tree/jndi-properties-variety/myejbclient
https://github.com/ochaloup/testing/tree/jndi-properties-variety/myejb

Comment 1 Ondrej Chaloupka 2012-06-14 22:54:28 UTC
Link: Added: This issue relates to JBPAPP-9318


Comment 2 Jaikiran Pai 2012-06-18 09:55:54 UTC
Can you please attach the thread dumps from the client side and the server side when this happens?


Comment 3 Rajesh Rajasekaran 2012-06-18 19:32:48 UTC
Labels: Added: eap6_need_triage


Comment 4 Ondrej Chaloupka 2012-06-20 08:56:29 UTC
Hi,
I'm adding thread dumps of the client and server in case of stuck the client. I found out that it happens for me now after the starting server and first connection of the client. When the client tries to connect second time (I switched it off and started it again and server was still running) then the client throws the following message and finally connected successfully. But after restarting the server then the problem occurs again.

{code}
Jun 20, 2012 10:45:40 AM org.jboss.ejb.client.EJBClient <clinit>
INFO: JBoss EJB Client version 1.0.10.Final-redhat-1
Staying before while cycle
Jun 20, 2012 10:45:40 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.4.GA-redhat-1
Jun 20, 2012 10:45:40 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.4.GA-redhat-1
Jun 20, 2012 10:45:40 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.8.GA-redhat-1

Jun 20, 2012 10:45:45 AM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector setupEJBReceivers
WARN: Could not register a EJB receiver for connection to 192.168.56.103:4447
java.lang.RuntimeException: Operation failed with status WAITING
        at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:93)
        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:119)
        at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.<init>(ConfigBasedEJBClientContextSelector.java:76)
        at org.jboss.ejb.client.EJBClientContext.<clinit>(EJBClientContext.java:77)
        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:120)
        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
        at $Proxy0.sayHello(Unknown Source)
        at client.Client.main(Client.java:52)
Jun 20, 2012 10:45:45 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Jun 20, 2012 10:45:45 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@b5dac4, receiver=Remoting connection EJB receiver [connection=Remoting connection <1a42792>,channel=jboss.ejb,nodename=ibm-x3655]} on channel Channel ID a4095eaf (outbound) of Remoting connection 00c5495e to /192.168.56.102:4447
Jun 20, 2012 10:45:45 AM org.jboss.ejb.client.remoting.VersionReceiver handleMessage
INFO: EJBCLIENT000017: Received server version 1 and marshalling strategies [river]
Jun 20, 2012 10:45:45 AM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate
INFO: EJBCLIENT000013: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@b5dac4, receiver=Remoting connection EJB receiver [connection=Remoting connection <1d2b01b>,channel=jboss.ejb,nodename=ibm-x365500]} on channel Channel ID b80e0769 (outbound) of Remoting connection 0054c4ad to /192.168.56.101:4447
{code}

Comment 5 Ondrej Chaloupka 2012-06-20 08:56:29 UTC
Attachment: Added: server-thread-dump.txt
Attachment: Added: client-thread-dump.txt


Comment 6 Ondrej Chaloupka 2012-06-20 09:03:15 UTC
I'm adding two more files with thread dumps in case that the client hangs to connect and the server gets signal to switch off. Then the server is stuck just as client. 
When either client or server is killed (kill -9) then the second component in the connection is stopped as well.

Comment 7 Ondrej Chaloupka 2012-06-20 09:03:15 UTC
Attachment: Added: client-thread-dump-server-stuck.txt
Attachment: Added: server-stuck-thread-dump.txt


Comment 8 Rajesh Rajasekaran 2012-07-11 19:52:34 UTC
Labels: Removed: eap6_need_triage Added: eap601candidate


Comment 9 Ondrej Chaloupka 2012-08-16 07:11:42 UTC
Forum Reference: Added: https://community.jboss.org/thread/204036


Comment 10 Ondrej Chaloupka 2012-10-01 14:38:52 UTC
Labels: Removed: eap601candidate Added: eap601-qe-triage eap601candidate


Comment 11 Ondrej Chaloupka 2012-10-01 14:39:27 UTC
Updating labels to be in sync with the reporting jira: JBPAPP-9318

Comment 12 Anne-Louise Tangring 2012-10-08 15:03:55 UTC
Not approved for EAP 6.0.1. If this should be reconsidered, please add the label: eap601-qe-triage

Comment 13 Anne-Louise Tangring 2012-10-08 15:03:55 UTC
Labels: Removed: eap601-qe-triage eap601candidate 
Forum Reference: Removed: https://community.jboss.org/thread/204036 Added: https://community.jboss.org/thread/204036


Comment 14 Anne-Louise Tangring 2012-11-13 20:57:53 UTC
Docs QE Status: Removed: NEW 


Comment 15 Ondrej Chaloupka 2013-08-21 10:18:32 UTC
Hi Jaikiran,

I've retested this on EAP 6.1.1.ER6 and I'm not able to reproduce it on this version of EAP.

Have you fixed this already? Please, what is status of this issue?

Thanks 
Ondra

Comment 17 Dimitris Andreadis 2013-10-24 18:27:22 UTC
Assigning jpai EJB issues to david.lloyd. Please re-assign to Cheng or others as needed.

Comment 19 Ladislav Thon 2014-09-10 12:32:07 UTC
This should probably be closed, as David indicates in comment 18, but he also says that some more work needs to be done. Is this still the case, David?