Github user jeking3 commented on a diff in the pull request:
https://github.com/apache/thrift/pull/1028#discussion_r67456476
--- Diff: lib/go/thrift/simple_server.go ---
@@ -149,8 +151,10 @@ func (p *TSimpleServer) Serve() error {
}
func (p *TSimpleServer) Stop() error {
- p.quit <- struct{}{}
- p.serverTransport.Interrupt()
+ if atomic.CompareAndSwapInt64(&p.stopped, 0, 1) {
--- End diff --
When I looked at the go documentation for CompareAndSwapInt64 the
documentation states that it returns the old value, so I assume you want the
quit and interrupt code to run when this method returns 0, meaning it is the
first time it has run.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---