[jira] [Commented] (THRIFT-4659) golang race detected when closing listener socket

2018-12-11 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on THRIFT-4659:


dcelasun closed pull request #1645: THRIFT-4659 golang race detected when 
closing listener socket
URL: https://github.com/apache/thrift/pull/1645
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/go/thrift/server_socket.go b/lib/go/thrift/server_socket.go
index 80313c4be5..7dd24ae364 100644
--- a/lib/go/thrift/server_socket.go
+++ b/lib/go/thrift/server_socket.go
@@ -75,7 +75,9 @@ func (p *TServerSocket) Accept() (TTransport, error) {
return nil, errTransportInterrupted
}
 
+   p.mu.Lock()
listener := p.listener
+   p.mu.Unlock()
if listener == nil {
return nil, NewTTransportException(NOT_OPEN, "No underlying 
server socket")
}
@@ -115,19 +117,20 @@ func (p *TServerSocket) Addr() net.Addr {
 }
 
 func (p *TServerSocket) Close() error {
-   defer func() {
-   p.listener = nil
-   }()
+   var err error
+   p.mu.Lock()
if p.IsListening() {
-   return p.listener.Close()
+   err = p.listener.Close()
+   p.listener = nil
}
-   return nil
+   p.mu.Unlock()
+   return err
 }
 
 func (p *TServerSocket) Interrupt() error {
p.mu.Lock()
-   defer p.mu.Unlock()
p.interrupted = true
+   p.mu.Unlock()
p.Close()
 
return nil


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> golang race detected when closing listener socket
> -
>
> Key: THRIFT-4659
> URL: https://issues.apache.org/jira/browse/THRIFT-4659
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Library
>Affects Versions: 0.11.0
>Reporter: Jay Gheewala
>Assignee: Can Celasun
>Priority: Major
> Attachments: THRIFT-4659.diff
>
>
> Race condition is deteced for following write/read
>  
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:119
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Close()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:122
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Interrupt()
>  
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Accept()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:78
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).innerAccept()
> git.apache.org/thrift.git/lib/go/thrift/simple_server.go:129
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).AcceptLoop()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4659) golang race detected when closing listener socket

2018-12-10 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot commented on THRIFT-4659:


jgheewala opened a new pull request #1645: THRIFT-4659 golang race detected 
when closing listener socket
URL: https://github.com/apache/thrift/pull/1645
 
 
   Some helpful tips for a successful Apache Thrift PR:
   
   * Did you test your changes locally or using CI in your fork? 
   Tested changes locally
   * Is the Apache Jira THRIFT ticket identifier in the PR title?
   Yes
   * Is the Apache Jira THRIFT ticket identifier in the commit message?
   Yes
   * Did you squash your changes to a single commit?
   Yes
   * Are these changes backwards compatible? (please say so in PR description)
   * Do you need to update the language-specific README?
   
   Client: [go]
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> golang race detected when closing listener socket
> -
>
> Key: THRIFT-4659
> URL: https://issues.apache.org/jira/browse/THRIFT-4659
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Library
>Affects Versions: 0.11.0
>Reporter: Jay Gheewala
>Assignee: Can Celasun
>Priority: Major
> Attachments: THRIFT-4659.diff
>
>
> Race condition is deteced for following write/read
>  
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:119
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Close()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:122
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Interrupt()
>  
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Accept()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:78
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).innerAccept()
> git.apache.org/thrift.git/lib/go/thrift/simple_server.go:129
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).AcceptLoop()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4659) golang race detected when closing listener socket

2018-11-13 Thread Can Celasun (JIRA)


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

Can Celasun commented on THRIFT-4659:
-

[~jgheewala_signalfx] looks good, please open a Github PR so the entire test 
suite can run.

> golang race detected when closing listener socket
> -
>
> Key: THRIFT-4659
> URL: https://issues.apache.org/jira/browse/THRIFT-4659
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Library
>Affects Versions: 0.11.0
>Reporter: Jay Gheewala
>Assignee: Can Celasun
>Priority: Major
> Attachments: THRIFT-4659.diff
>
>
> Race condition is deteced for following write/read
>  
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:119
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Close()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:122
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Interrupt()
>  
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Accept()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:78
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).innerAccept()
> git.apache.org/thrift.git/lib/go/thrift/simple_server.go:129
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).AcceptLoop()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4659) golang race detected when closing listener socket

2018-11-06 Thread Jay Gheewala (JIRA)


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

Jay Gheewala commented on THRIFT-4659:
--

[~calcifer] i have attached a potential diff that I tested locally. Let me know 
if that works.

Thanks,
Jay Gheewala

 

 

> golang race detected when closing listener socket
> -
>
> Key: THRIFT-4659
> URL: https://issues.apache.org/jira/browse/THRIFT-4659
> Project: Thrift
>  Issue Type: Bug
>  Components: Go - Library
>Affects Versions: 0.11.0
>Reporter: Jay Gheewala
>Assignee: Can Celasun
>Priority: Major
> Attachments: THRIFT-4659.diff
>
>
> Race condition is deteced for following write/read
>  
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:119
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Close()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:122
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Interrupt()
>  
> git.apache.org/thrift.git/lib/go/thrift.(*TServerSocket).Accept()
> git.apache.org/thrift.git/lib/go/thrift/server_socket.go:78
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).innerAccept()
> git.apache.org/thrift.git/lib/go/thrift/simple_server.go:129
> git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).AcceptLoop()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)