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

Jens Geyer edited comment on THRIFT-2696 at 9/14/14 6:18 PM:
-------------------------------------------------------------

TTcpSocketStreamImpl.Read does not return an error code. it returms the bytes 
read. When 0, the calling code in {{TTransportImpl}} assumes the client closed 
his end. {{TTransportImpl}} itself is transport-agnostic, so changing anything 
here may easily lead to more side effects with other transports. 

With regard to the timeout, I would expect it to behave this way, otherwise I 
can do a simple DOS by opening the socket and never closing it. If I don't want 
this, leave the default timeout = wait forever. However, that leaves us with 
the same situation as above, so that's a problem indeed.

Could you give [this 
patch|^THRIFT-2696-Unable-to-stop-socket-server-while-there_v2.patch] a try if 
that works for you? I tried to cover all possible scenarios now.



was (Author: jensg):
TTcpSocketStreamImpl.Read does not return an error code. it returms the bytes 
read. When 0, the calling code in {{TTransportImpl}} assumes the client closed 
his end. {{TTransportImpl}} itself is transport-agnostic, so changing anything 
here may easily lead to more side effects with other transports. 

With regard to the timeout, I would expect it to behave this way, otherwise I 
can do a simple DOS by opening the socket and never closing it. If I don't want 
this, leave the default timeout = wait forever. However, that leaves us with 
the same situation as above, so that's a problem indeed.

Could you give my patch a try if that works for you? I tried to cover all 
possible scenarios now.


> Unable to stop socket server while there are idle clients
> ---------------------------------------------------------
>
>                 Key: THRIFT-2696
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2696
>             Project: Thrift
>          Issue Type: Bug
>          Components: Delphi - Library
>    Affects Versions: 0.9
>            Reporter: Severian Duchenko
>            Assignee: Jens Geyer
>         Attachments: 
> THRIFT-2696-Unable-to-stop-socket-server-while-there.patch, 
> THRIFT-2696-Unable-to-stop-socket-server-while-there_v2.patch, patch.txt
>
>
> When TSimpleServer created using TServerSocketImpl and there are idle clients 
> (connected, but not sending anything), it is impossible to stop server.
> After executing TSimpleServer.stop server will not stop until client is 
> disconnected or does not send anything.



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

Reply via email to