You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ben Craig (JIRA)" <ji...@apache.org> on 2015/07/07 22:39:07 UTC

[jira] [Commented] (THRIFT-3226) Fix TNamedPipeServer trapped in loop on accept

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

Ben Craig commented on THRIFT-3226:
-----------------------------------

Don't try to use closed transports.  Calling interrupt() before a server starts to serve should work, and will hopefully satisfy your use case.

> Fix TNamedPipeServer trapped in loop on accept
> ----------------------------------------------
>
>                 Key: THRIFT-3226
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3226
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.2
>            Reporter: Paweł Janicki
>            Assignee: Paweł Janicki
>            Priority: Critical
>              Labels: patch
>         Attachments: 0001-THRIFT-3226.-cpp-Fix-TNamedPipeServer-trapped-in-loo.patch
>
>
> TNamedPipeServer can trap itself in infinite loop if the client closed Pipe before server instantiated TPipe object in NamedPipeServer::acceptImpl().
> The accept loop waits for connected client on GetOverlappedResult(Pipe_.h , ..) then wraps the connected pipe client hande into TPipe object, opens another pipe handle to wait for next client and returns the newly created pipe wrapper object.
> TPipe object may throw on c-tor if the pipe in meantime has been closed by the client. If so the new pipe instance for next client will NOT be created as the implementation expects. The accept is called with no inital valid pipe handle what causes it to throw and restart accept. It happens then forever.
> I propose to solve the issue by handling the case when TPipe throws: The failed handle should be dropped and new pipe created and wait for next client repeated within acceptImpl



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