[
http://jira.jboss.com/jira/browse/JBREM-890?page=comments#action_12393337 ]
Ron Sigal commented on JBREM-890:
---------------------------------
Various changes have been made to the server side of the socket transport in response to
JBREM-821 "JBoss Remoting fails under load". In particular,
2) The connector close process is not clean. I would suggest the code should be changed
so the server threads are shut down at the beginning of the connector close process.
I.e.
a) Wait for current invocations on that server invoker to complete - and don't
allow any more.
b) Once all are complete shut it down.
Additional synchronization was added in response. However, one mistake was to synchronize
ServerThread.evict(). The problem is that the SocketServerInvoker AcceptorThread could
call ServerThread.evict() while the ServerThread was in the synchronized method
completeInvocation(), which could leave the AcceptorThread blocked while a different
ServerThread returned itself to the threadpool.
ServerThread has been changed so that ServerThread.evict() is not synchronized, but a
synchronized flag is added so that evict() will shut down the ServerThread's
SocketWrapper only if the ServerThread is in Acknowledge() or readVersion().
ServerThread.evict() has also been changed to return a boolean value which indicates if
the eviction attempt (i.e., closing the SocketWrapper) was attempted.
org.jboss.remoting.transport.socket.LRUPool, which is the type of
SocketServerInvoker.clientpool - which holds ServerThreads currently in use, has been
changed to loop through the used threads until a call to ServerThread.evict() returns
true. If no such ServerThread exists, LRUPool will set a flag which can be retrieved with
the new method LRUPool.getEvictionNeeded(). At the top of each loop in doRun(),
ServerThread will call LRUPool.getEvictionNeeded() and return itself to
SocketServerInvoker.threadpool - which holds unused ServerThreads - if getEvictionNeeded()
returns true.
Fix thread pool eviction in socket transport
--------------------------------------------
Key: JBREM-890
URL:
http://jira.jboss.com/jira/browse/JBREM-890
Project: JBoss Remoting
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 2.4.0.Beta1 (Pinto), 2.2.2.SP4
Reporter: Ron Sigal
Assigned To: Ron Sigal
Fix For: 2.4.0.Beta1 (Pinto)
Currently org.jboss.rermoting.transport.socket.ServerThread.evict() attempts to interrupt
a thread blocked on i/o in acknowledge() or readVersion() and return it to
SocketServerInvoker.threadpool where it can be reused. However, interrupt() will not
normally unblock a thread in an i/o call.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira