85876310af
In runservice readdb Run method we could end with a deadlock if two of the goroutines that call HandleEvents.* try to write to the errCh at the same time before the errCh is read. If this happens one of the two will be blocked on writing to the channel but the read won't happen since it'll blocked by wg.Wait(). Fix this doing: * use a buffered channel large as the number of executed goroutines. * create a new errCh at every loop (so we'll ignore later errors after the first one) Note: we could also use a non blocking send to avoid this situation but we should also start the wg.Wait before the goroutines or earlier errors could be lost causing another kind of hang. |
||
---|---|---|
.. | ||
action | ||
api | ||
common | ||
readdb | ||
configstore.go | ||
configstore_test.go |