You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If err != nil at line 170 in the first iteration of the range, then method preload() will return while three goroutines are stuck:
Two goroutines are stuck at line 159 waiting to send on channel ch which is full.
One goroutine is stuck at line 164 waiting on wg (which needs the two goroutines above to finish).
A potential fix is to change line 141 ch := make(chan *storagepb.SubtreeProto, len(want)) to ch := make(chan *storagepb.SubtreeProto, int(math.Max(len(want), len(subtrees)))
FYI, I have found this bug with my tool Gomela which is a static analyser for concurrent Go programs. Let me know if you find this useful!
The text was updated successfully, but these errors were encountered:
No problem!
Yes this would be a good addition since getSubstrees is given as a parameter.
Ok I will keep you posted if my tool still reports a goroutine leak!
I think there is a potential goroutine leak in method preload() at lines 108-187 of storage/cache/subtree_cache.go.
For instance, assume:
If err != nil at line 170 in the first iteration of the range, then method preload() will return while three goroutines are stuck:
A potential fix is to change line 141
ch := make(chan *storagepb.SubtreeProto, len(want))
toch := make(chan *storagepb.SubtreeProto, int(math.Max(len(want), len(subtrees)))
FYI, I have found this bug with my tool Gomela which is a static analyser for concurrent Go programs. Let me know if you find this useful!
The text was updated successfully, but these errors were encountered: