提交 5eb08c44 作者: Jeromy

add warning comment about possibly leaked goroutines

上级 8ed0f4b8
...@@ -260,6 +260,9 @@ loop: ...@@ -260,6 +260,9 @@ loop:
select { select {
case <-done: case <-done:
case <-ctx.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 return nil
} }
...@@ -412,6 +415,9 @@ func (bs *Bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) { ...@@ -412,6 +415,9 @@ func (bs *Bitswap) wantNewBlocks(ctx context.Context, bkeys []u.Key) {
select { select {
case <-done: case <-done:
case <-ctx.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
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论