hernanrengifo / jca-sockets

Automatically exported from code.google.com/p/jca-sockets
0 stars 0 forks source link

Socket Adapter doesn't respond to first socket request #18

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Followed instructions for deployment (wrote a socket-invoked MDB, etc.) 
2. Send a few messages from a client
3. The first few fail to garner responses; eventually one will get through and 
get some responses, but these dry up quickly.

What is the expected output? What do you see instead?

I am expecting the first client to get connected. I am also not expecting the 
sudden failures.

What version of the product are you using? On what operating system?

Using the most recent version (1.2.3) on OS X, my app server is Glassfish 3.

Please provide any additional information below.

I am also seeing blanket failures with the following exception:

"SEVERE: Error while accepting a socket request and scheduling work on the 
request. See linked exception
javax.resource.spi.work.WorkRejectedException: error code: 1
        at com.sun.enterprise.connectors.work.WorkCoordinator.workTimedOut
        ..."

This occurs just after an accept (I'm seeing "INFO: Allocated endpoint, 
poolsize 1 of 5" immediately prior in the logs.)

Original issue reported on code.google.com by jweissma...@gmail.com on 21 Jun 2011 at 5:57

GoogleCodeExporter commented 8 years ago
Note there are two separate issues -- I'm not seeing the WorkRejectedException 
every time, strangely enough.

Original comment by jweissma...@gmail.com on 21 Jun 2011 at 5:58

GoogleCodeExporter commented 8 years ago
I am trying to more closely mirror the socket settings in the example. Some 
improvement but I'm still seeing periodic timeouts on accepts. Will try to 
update here when I have more data points.

Original comment by jweissma...@gmail.com on 21 Jun 2011 at 7:10

GoogleCodeExporter commented 8 years ago
probably should've checked this first, but it works great with the example 
onMessage setup. i'll have to refactor my receive methodology. basically, i'm 
not interesting in line-oriented protocols, and i want to use data input/output 
streams -- but this seems to be triggering the issues i'm seeing. at any rate, 
you can probably mark this closed.

Original comment by jweissma...@gmail.com on 21 Jun 2011 at 7:41

GoogleCodeExporter commented 8 years ago
i'm still unable to get this working, even under GF2. i'm apparently seeing the 
issue even with the provided socket-ejb. the basic issue is that i'll see 
'endpoint allocated' but it doesn't seem to trigger onMessage.

this definitely is still a problem for me.

Original comment by jweissma...@gmail.com on 22 Jun 2011 at 7:16

GoogleCodeExporter commented 8 years ago
i'm also seeing this exception in my logs, occasionally:

Error while accepting a socket request and scheduling work on the request. See 
linked exception
javax.resource.spi.work.WorkRejectedException: error code: 1
        at com.sun.enterprise.connectors.work.WorkCoordinator.workTimedOut(WorkCoordinator.java:255)
        at com.sun.enterprise.connectors.work.WorkCoordinator.preInvoke(WorkCoordinator.java:153)
        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:73)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)

Original comment by jweissma...@gmail.com on 22 Jun 2011 at 7:18

GoogleCodeExporter commented 8 years ago
I was having an almost identical problem,  my clients would hang occasionally 
and I did get the listed exception a few times. 

Problem seems to be that when work is rejected the client socket isn't cleaned 
up.  I made the following modifications and the hanging stopped.  It doesn't 
resolve why the work was rejected but at least it recovers.

SocketProcessor.java: Added a cancelWork method which calls closeSocket to 
forcibly end the client's connection. 
EndpointPool.java:  In workRejected() modified to get the SocketProcessor and 
call the cancelWork method and add release the messageEndpoint.

Original comment by jsol...@gmail.com on 20 Jul 2011 at 8:40

GoogleCodeExporter commented 8 years ago
I found this project lately and had the same issue on Weblogic 12c.
The WorkRejectedException is thrown by the WorkManager when it fails to start 
the job within the specified time limit (WorkManager.IMMEDIATE = 0 in this 
case). Allowing 100ms to start the job resolved the issue.
Also, you can resubmit a job if it is rejected with WorkRejectedException and 
error code 1. (Error code -1 means the WorkManage is suspended or stopped, so 
don't retry it in this case).

Original comment by balazsv...@gmail.com on 27 Jun 2014 at 11:08