[ 
https://issues.apache.org/jira/browse/THRIFT-2441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14386751#comment-14386751
 ] 

James E. King, III commented on THRIFT-2441:
--------------------------------------------

The code in TSocket and TSSLSocket both protect against a double close by 
setting the socket value to something invalid and testing for it.  Any 
transport close() must defend against this behavior.  This means socket close 
happens once and only once, however since the TThreadedServer::Task::run() 
calls close() in the task thread and the newly added stop() calls close() in 
another thread, they need to be mutually exclusive for it truly to be "once and 
only once", and this patch doesn't do that.  Thank you for pointing this out.

> Cannot shutdown TThreadedServer when clients are still connected
> ----------------------------------------------------------------
>
>                 Key: THRIFT-2441
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2441
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.1
>            Reporter: Chris Stylianou
>            Assignee: Roger Meier
>
> When calling stop() on the TThreadedServer no interrupts are sent to the 
> client threads. This means the stop() call blocks on tasksMonitor.wait() 
> until all client naturally disconnect.
> How can we tell the client thread connections to close/exit during the 
> TThreadedServer::stop() call?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to