[
https://issues.apache.org/jira/browse/THRIFT-3226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paweł Janicki updated THRIFT-3226:
----------------------------------
Attachment: ConsoleApplication1.cpp
Issue demonstration
> 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,
> ConsoleApplication1.cpp
>
>
> 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)