Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.10.0
Description
I found issue https://issues.apache.org/jira/browse/THRIFT-2441 and I believe that the same problem still exists in the Java servers, and I'm affected by it. Short summary: I can not shut down the Java server (neither TSimpleServer nor TThreadedServer) while clients are still connected. That is pretty bad, because essentially the clients are not under by control, but they can essentially "block" server maintenance operations by blocking the shutdown.
In more detail: I have a Java TSimpleServer runnable in a thread running. The main thread eventually asks the server to stop(). But they seem to ignore the request. I checked the code of TSimpleServer.java and I'm under the impression that the innermost loop the server does not poll the variable stopped_ or does it? Looking at https://github.com/apache/thrift/blob/master/lib/java/src/org/apache/thrift/server/TSimpleServer.java from line 76:
while (true) { if (eventHandler_ != null) { eventHandler_.processContext(connectionContext, inputTransport, outputTransport); } if(!processor.process(inputProtocol, outputProtocol)) { break; } }
I found that this loop is only interrupted if the client disconnects. I tried changing while(true) for while(!stopped_) but that did not help. I guess that one of the methods in the loop must be blocking.
Attachments
Issue Links
- fixes
-
ZEPPELIN-5249 Update to thrift 0.14.1
- Open
- is duplicated by
-
THRIFT-4598 TBinaryProtocol.readMessageBegin() hangs forever in Java
- Closed
- is related to
-
THRIFT-2441 Cannot shutdown TThreadedServer when clients are still connected
- Closed
- relates to
-
THRIFT-4500 Unable to stop socket server while there are connected clients
- Open
- links to