Bug 1030936 - JBAS014249 if a fire and forget asynchronous ejb call is made
Summary: JBAS014249 if a fire and forget asynchronous ejb call is made
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EJB
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR3
: EAP 6.4.0
Assignee: jboss-set
QA Contact: Jan Martiska
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-15 11:16 UTC by wfink
Modified: 2019-08-19 12:45 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer (5.94 MB, application/zip)
2014-09-22 09:28 UTC, Jan Martiska
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-2515 0 Major Closed JBAS014249 if a fire and forget asynchronous ejb call is made 2018-04-03 23:30:41 UTC

Internal Links: 1030484

Description wfink 2013-11-15 11:16:59 UTC
If an ejb method
@Asynchronous void fireAndForget(...)
is called remote and the client disconnect an Exception JBAS014249 will be thrown if the async method return.

11:02:27,544 INFO  [org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccessBean] (EJB default - 1) action 'fireAndForget' finished
11:02:27,547 ERROR [org.jboss.as.ejb3] (EJB default - 1) JBAS014249: Error invoking method public abstract void org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccess.fireAndForget(long) on bean named AsynchronousAccessBean for appname  modulename jboss-ejb-asynchronous-ejb distinctname : java.lang.NullPointerException
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.invokeMethod(MethodInvocationMessageHandler.java:322)
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$100(MethodInvocationMessageHandler.java:70)
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1]

11:02:27,552 ERROR [org.jboss.as.ejb3] (EJB default - 1) JBAS014250: Could not write method invocation failure for method public abstract void org.jboss.as.quickstarts.ejb.asynchronous.AsynchronousAccess.fireAndForget(long) on bean named AsynchronousAccessBean for appname  modulename jboss-ejb-asynchronous-ejb distinctname  due to: java.io.IOException: JBAS014560: Could not open message outputstream for writing to Channel
	at org.jboss.as.ejb3.remote.protocol.AbstractMessageHandler.writeException(AbstractMessageHandler.java:102)
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.access$400(MethodInvocationMessageHandler.java:70)
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:213)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
	at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar:2.1.1.Final-redhat-1]
Caused by: org.jboss.remoting3.NotOpenException: Writes closed
	at org.jboss.remoting3.remote.RemoteConnectionChannel.openOutboundMessage(RemoteConnectionChannel.java:108) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
	at org.jboss.remoting3.remote.RemoteConnectionChannel.writeMessage(RemoteConnectionChannel.java:297) [jboss-remoting-3.2.16.GA-redhat-1.jar:3.2.16.GA-redhat-1]
	at org.jboss.as.ejb3.remote.protocol.versionone.ChannelAssociation.acquireChannelMessageOutputStream(ChannelAssociation.java:68)
	at org.jboss.as.ejb3.remote.protocol.AbstractMessageHandler.writeException(AbstractMessageHandler.java:100)
	... 9 more

Comment 1 Jan Martiska 2014-07-02 10:52:48 UTC
This worked in EAP 6.0 but it doesn't in 6.1/6.2/6.3.. It's a regression but probably not really a blocker, as it doesn't seem to affect applications, just  logs. Proposing for 6.4.

Comment 2 Kabir Khan 2014-09-15 16:05:41 UTC
https://github.com/jbossas/jboss-eap/pull/1681

Comment 3 Jan Martiska 2014-09-17 14:03:31 UTC
The fix doesn't seem to resolve the issue to me, I am still getting the exact same exception.

The JBAS014249 message is (I think, at least in my case) logged here:
https://github.com/jbossas/jboss-eap/blob/EAP_6.4.0.DR1-dev-2/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/MethodInvocationMessageHandler.java#L220

so checking for isAsyncVoid only at 
https://github.com/jbossas/jboss-eap/blob/EAP_6.4.0.DR1-dev-2/ejb3/src/main/java/org/jboss/as/ejb3/remote/protocol/versionone/MethodInvocationMessageHandler.java#L249

isn't enough.

Comment 4 Dominik Pospisil 2014-09-22 08:39:14 UTC
Jan, could you please provide more info what is your use case and exact stack trace? If your exception has been thrown at line 220, my understanding is that it happened during method invocation so logging it in such case shoud be fine.

Comment 5 Dominik Pospisil 2014-09-22 08:51:44 UTC
What I wanted to say is that we are definitely not trying to avoid logging such exception alltogether.

Comment 6 Jan Martiska 2014-09-22 09:28:00 UTC
Created attachment 939935 [details]
reproducer

Comment 7 Jan Martiska 2014-09-22 09:28:47 UTC
(In reply to Dominik Pospisil from comment #4)
> Jan, could you please provide more info what is your use case and exact
> stack trace? If your exception has been thrown at line 220, my understanding
> is that it happened during method invocation so logging it in such case
> shoud be fine.

That's exactly how I understand this issue - the client disconnects WHILE the invocation is still running. My scenario is:
- The client invokes an async void method
- The async method starts a 5 seconds wait
- The client disconnects before the method finishes

This scenario used to work correctly on EAP 6.0 (without exceptions in server log).

If I understand correctly, your scenario expects that the client disconnects while the server is trying to write out the invocation result, which is a really short timespan - quite unlikely to hit.

My stacktrace is completely the same as in the bug description:
	at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler$1.run(MethodInvocationMessageHandler.java:203)
----> this element shows that it occurs during result = invokeMethod(...)

Attached a reproducer with my scenario.

Comment 8 Dominik Pospisil 2014-09-23 15:31:33 UTC
Thanks. This is in fact manifestation of yet another issue - invocation of void async method never finishes successfully. The invokeMethod(...) should finish normally even if the client disconects.

PR sent: https://github.com/jbossas/jboss-eap/pull/1707

Comment 9 Kabir Khan 2014-09-26 12:03:43 UTC
https://github.com/jbossas/jboss-eap/pull/1707

Comment 10 Jan Martiska 2014-10-01 08:49:53 UTC
Works fine in EAP 6.4.0.DR3, thanks.


Note You need to log in before you can comment on or make changes to this bug.