Mario Emmenlauer
2017-07-13 13:04:20 UTC
Dear All,
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?
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;
}
}
Do I understand correctly that the TSimpleServer will only check
stopped_ when there is no client connected? Personally I would
prefer if the client can not "force" my server to continue running.
If required, clients should be forcibly disconnected on stop().
Is there a way to achieve that? I found no methods "forceStop()" or
"disconnectClients()" or something like it. Am I even on the right
track?
All the best,
Mario Emmenlauer
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?
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;
}
}
Do I understand correctly that the TSimpleServer will only check
stopped_ when there is no client connected? Personally I would
prefer if the client can not "force" my server to continue running.
If required, clients should be forcibly disconnected on stop().
Is there a way to achieve that? I found no methods "forceStop()" or
"disconnectClients()" or something like it. Am I even on the right
track?
All the best,
Mario Emmenlauer