[ https://issues.apache.org/jira/browse/THRIFT-3855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15563236#comment-15563236 ]
Patrick Bennett commented on THRIFT-3855: ----------------------------------------- I didn't see it anywhere else but my problem is actually that Stop doesn't actually interrupt the waiting Accept call. If I start my service and something calls Stop (my ctrl-c handler) then it just 'hangs' until a new client connects. AcceptLoop calls Accept in a loop and Accept blocks until the server accepts a new connection, so there's nothing to actually 'stop' the server in that accept. The problem is that SimpleServer.Stop calls Interrupt (which sets the interrupted variable in ServerSocket [in my case]) but doesn't do anything to abort the open listener. If I change SimpleServer Stop to ``` func (p *TSimpleServer) Stop() error { p.quit <- struct{}{} p.serverTransport.Interrupt() p.serverTransport.Close() return nil } ``` Then it works fine. > In the go simple server, if Stop() is called multiple times it hangs > -------------------------------------------------------------------- > > Key: THRIFT-3855 > URL: https://issues.apache.org/jira/browse/THRIFT-3855 > Project: Thrift > Issue Type: Bug > Components: Go - Library > Affects Versions: 0.9.3 > Reporter: James E. King, III > Assignee: Paul Finkelshteyn > Priority: Minor > Fix For: 0.10.0 > > > From the submitter huaiwan: > {quote} > huaiyun commented 18 hours ago > When Stop() is called twice or more, and no new connection accepted from > AcceptLoop(), the Stop() will be blocked because the quit channel is full. > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)