broker: simplify ctx check
@@ -255,14 +255,15 @@ func (b *broker) handleReqs() {
// Juuuust before we issue the request, we check if it was
// canceled. If it is not, we do not cancel hereafter.
- if tryDone := pr.ctx.Done(); tryDone != nil {
+ // We only check the promised req's ctx, not our clients.
+ // The client ctx is closed on shutdown, which kills the
+ // cxn anyway.
select {
- case <-tryDone:
+ case <-pr.ctx.Done():
pr.promise(nil, pr.ctx.Err())
continue
default:
}
- }
correlationID, err := cxn.writeRequest(req)
if err != nil {
