Permalink
Browse files

Apiserver race condition fix

Fixes a race condition i noticed in cmd/jujud/agent running go test --race ...
  • Loading branch information...
1 parent 03e984b commit c147767de940cd07db3330ac3a19f9f3547d4be1 @alesstimec alesstimec committed Jun 30, 2015
Showing with 2 additions and 0 deletions.
  1. +2 −0 apiserver/apiserver.go
View
@@ -135,6 +135,8 @@ func (cl *changeCertListener) Close() error {
// processCertChanges receives new certificate information and
// calls a method to update the listener's certificate.
func (cl *changeCertListener) processCertChanges() error {
+ cl.m.Lock()
+ defer cl.m.Unlock()
for {
select {
case info := <-cl.certChanged:

0 comments on commit c147767

Please sign in to comment.