mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
client: don't retry fingerprinting on shutdown
At shutdown, driver manager context expires and the fingerprinting channel closes. Thus it is undeterministic which clause of The select statement gets executed, and we may keep retrying until the `i.ctx.Done()` block is executed. Here, we check always check ctx expiration before retrying again.
This commit is contained in:
@@ -307,6 +307,12 @@ func (i *instanceManager) fingerprint() {
|
||||
continue
|
||||
}
|
||||
|
||||
// avoid fingerprinting again if ctx and fpChan both close
|
||||
if i.ctx.Err() != nil {
|
||||
cancel()
|
||||
return
|
||||
}
|
||||
|
||||
// if the channel is closed attempt to open a new one
|
||||
newFpChan, newCancel, err := i.dispenseFingerprintCh()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user