From 5eb08c44736b920cfffc8560a501071098007fd3 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Mon, 9 Mar 2015 00:03:59 -0700 Subject: [PATCH] add warning comment about possibly leaked goroutines --- exchange/bitswap/bitswap.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exchange/bitswap/bitswap.go b/exchange/bitswap/bitswap.go index 91105b20a..649b3cc48 100644 --- a/exchange/bitswap/bitswap.go +++ b/exchange/bitswap/bitswap.go @@ -260,6 +260,9 @@ loop: select { case <-done: case <-ctx.Done(): + // NB: we may be abandoning goroutines here before they complete + // this shouldnt be an issue because they will complete soon anyways + // we just don't want their being slow to impact bitswap transfer speeds } return nil } @@ -412,6 +415,9 @@ func (bs *Bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) { select { case <-done: case <-ctx.Done(): + // NB: we may be abandoning goroutines here before they complete + // this shouldnt be an issue because they will complete soon anyways + // we just don't want their being slow to impact bitswap transfer speeds } }