diff --git a/diagnostics/diag.go b/diagnostics/diag.go
index <HASH>..<HASH> 100644
--- a/diagnostics/diag.go
+++ b/diagnostics/diag.go
@@ -191,7 +191,11 @@ func (d *Diagnostics) getDiagnosticFromPeers(ctx context.Context, peers map[peer
 				return
 			}
 			for d := range out {
-				respdata <- d
+				select {
+				case respdata <- d:
+				case <-ctx.Done():
+					return
+				}
 			}
 		}(p)
 	}
respect contexts when returning diagnostics responses

License: MIT