braintree / manners

A polite Go HTTP server that shuts down gracefully.
MIT License
997 stars 103 forks source link

race condition in listener.go #16

Closed kornel661 closed 10 years ago

kornel661 commented 10 years ago

GracefulListener is subject to race condition on its open bool field. According to the documentation of standard library

Multiple goroutines may invoke methods on a Listener simultaneously.

thus contending for read/write access to the open field. It seems that GracefulListener needs some kind of synchronization mechanism, e.g., a mutex.

lionelbarrow commented 10 years ago

Good call. Thanks for the PR.