Merge pull request #3220 from wpaulino/set-stopping-on-shutdown

server: properly set stopping atomic var upon shutdown
This commit is contained in:
Olaoluwa Osuntokun 2019-06-18 20:53:25 -07:00 committed by GitHub
commit ac2cea4126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1298,7 +1298,7 @@ func (s *server) Start() error {
// NOTE: This function is safe for concurrent access.
func (s *server) Stop() error {
s.stop.Do(func() {
atomic.LoadInt32(&s.stopping)
atomic.StoreInt32(&s.stopping, 1)
close(s.quit)