@cryptotaxi247 / kubo / commits / 5eb08c447

add warning comment about possibly leaked goroutines

Jeromy committed Mar 9, 2015 at 00:03 UTC 5eb08c44736b920cfffc8560a501071098007fd3
1 file changed +6
exchange/bitswap/bitswap.go
+6
@@ -260,6 +260,9 @@ loop:
260 select {
261 case <-done:
262 case <-ctx.Done():
263 + // NB: we may be abandoning goroutines here before they complete
264 + // this shouldnt be an issue because they will complete soon anyways
265 + // we just don't want their being slow to impact bitswap transfer speeds
266 }
267 return nil
268 }
@@ -412,6 +415,9 @@ func (bs *Bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) {
415 select {
416 case <-done:
417 case <-ctx.Done():
418 + // NB: we may be abandoning goroutines here before they complete
419 + // this shouldnt be an issue because they will complete soon anyways
420 + // we just don't want their being slow to impact bitswap transfer speeds
421 }
422 }
423