Merge pull request #1415 from mrjana/agent
Avoid double close of agentInitDone
This commit is contained in:
commit
24f44d9732
2 changed files with 11 additions and 2 deletions
|
@ -193,9 +193,12 @@ func (c *controller) agentSetup() error {
|
|||
}
|
||||
}
|
||||
|
||||
if c.agent != nil {
|
||||
c.Lock()
|
||||
if c.agent != nil && c.agentInitDone != nil {
|
||||
close(c.agentInitDone)
|
||||
c.agentInitDone = nil
|
||||
}
|
||||
c.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -347,7 +347,13 @@ func (c *controller) clusterAgentInit() {
|
|||
// AgentInitWait waits for agent initialization to be completed in the
|
||||
// controller.
|
||||
func (c *controller) AgentInitWait() {
|
||||
<-c.agentInitDone
|
||||
c.Lock()
|
||||
agentInitDone := c.agentInitDone
|
||||
c.Unlock()
|
||||
|
||||
if agentInitDone != nil {
|
||||
<-agentInitDone
|
||||
}
|
||||
}
|
||||
|
||||
func (c *controller) makeDriverConfig(ntype string) map[string]interface{} {
|
||||
|
|
Loading…
Add table
Reference in a new issue