Skip to content

Commit 4b82c89

Browse files
Merge pull request #3353 from ipfs/fix/diag-hang
respect contexts when returning diagnostics responses
2 parents a9df187 + 7728124 commit 4b82c89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

diagnostics/diag.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ func (d *Diagnostics) getDiagnosticFromPeers(ctx context.Context, peers map[peer
191191
return
192192
}
193193
for d := range out {
194-
respdata <- d
194+
select {
195+
case respdata <- d:
196+
case <-ctx.Done():
197+
return
198+
}
195199
}
196200
}(p)
197201
}

0 commit comments

Comments
 (0)