Merge pull request #11967 from LK4D4/fix_panic

Avoid ServeApi race condition
This commit is contained in:
Jessie Frazelle
2015-03-31 16:37:32 -07:00
2 changed files with 4 additions and 3 deletions
+3 -1
View File
@@ -82,7 +82,9 @@ func AcceptConnections(job *engine.Job) error {
// Tell the init daemon we are accepting requests
go systemd.SdNotify("READY=1")
// close the lock so the listeners start accepting connections
if activationLock != nil {
select {
case <-activationLock:
default:
close(activationLock)
}
return nil