Commit 0cfea7d9 authored by Mahmood Ali's avatar Mahmood Ali
Browse files

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.
Showing with 6 additions and 0 deletions
+6 -0
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment