braintree / manners

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

Serving + Closing in 2 separate routines is racy #38

Open alapidas opened 8 years ago

alapidas commented 8 years ago

Running ListenAndServe() and Close() in 2 separate routines causes the race detector to pick up a race condition, based on the fact that defaultServer has no synchronization protection around it.

Fixed by https://github.com/braintree/manners/pull/37

Worth noting, this change would make Close() block until ListenAndServe is actually called

lionelbarrow commented 8 years ago

This seems unlikely to cause real problems in production, but if it's causing the race detector to fire then 👍 .

gliptak commented 7 years ago

After https://github.com/braintree/manners/pull/37 merged, does this still trigger the race detector?