This discussion is archived
2 Replies Latest reply: Aug 4, 2010 12:49 AM by 652803 RSS

Incoming RA - stuck threads on socket.accept()?

768453 Newbie
Currently Being Moderated
Hi,

I've been working on this for a few days now and can't resolve an issue I'm having with an incoming Resource Adapter deployed on Weblogic 11g (10.3.2.0).

The RA creates a new Work (ie, thread) and performs a socket.accept() in the run() method of the work unit. This blocks indefinitely, which seems to result in Weblogic issuing BEA-000337 errors as follows:

<22-Apr-2010 09:45:52 o'clock BST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "698" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@55eea8ed", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
java.net.PlainSocketImpl.socketAccept(Native Method)
java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
java.net.ServerSocket.implAccept(ServerSocket.java:453)
java.net.ServerSocket.accept(ServerSocket.java:421)
com.googlecode.jcasockets.SocketListener.run(SocketListener.java:95)
weblogic.connector.security.layer.WorkImpl.runIt(WorkImpl.java:108)
weblogic.connector.security.layer.WorkImpl.run(WorkImpl.java:44)
weblogic.connector.work.WorkRequest.run(WorkRequest.java:95)
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

I'm not sure if it tries killing the offending thread or even the work manager - the documentation indicates that this should happen but I don't see any forced thread shutdowns in the logs and the RA continues accepting incoming connections.

I've tried creating a new Work Manager specifically for this RA with the "Ignore Stuck Threads" option specified. This gets rid of the BEA-000337 errors, however now when I try to perform a normal shutdown, the shutdown hangs indefinitely, presumably waiting for the 'stuck' work to complete.

The RA, on receiving the endpointDeactivation() or stop() callbacks will actually interrupt the socket.accept() call which is blocking the work, but these callbacks don't seem to get called by Weblogic until -after- the work has completed. So it appears to be a catch-22 situation.

If I 'force shutdown', the server ignores the 'stuck' work unit and calls the relevant callbacks on the RA which causes everything to shut down nicely from there on.




What would be the 'proper' way to deploy an incoming socket.accept() in a RA on WebLogic so that it doesn't cause stuck thread errors or block shutdowns? Obviosuly the WebLogic server handles this properly for its own listener sockets.

I'd prefer configuration settings to deal with this as the RA is running stable in other application servers, eg, GlassFish.

Forced shutdowns and recurring errors in the logs are not acceptable for production use.


Many thanks for any assistance,
- Micha.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points