From add7775564f2ef1c1f78b5cdd138bf710b141811 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Wed, 15 Feb 2023 12:50:01 -0800 Subject: [PATCH] fix(providerquerymanager): use find providers async context --- .../internal/providerquerymanager/providerquerymanager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitswap/client/internal/providerquerymanager/providerquerymanager.go b/bitswap/client/internal/providerquerymanager/providerquerymanager.go index 09bfc5b4e..6c846af29 100644 --- a/bitswap/client/internal/providerquerymanager/providerquerymanager.go +++ b/bitswap/client/internal/providerquerymanager/providerquerymanager.go @@ -378,8 +378,8 @@ func (npqm *newProvideQueryMessage) debugMessage() string { func (npqm *newProvideQueryMessage) handle(pqm *ProviderQueryManager) { requestStatus, ok := pqm.inProgressRequestStatuses[npqm.k] if !ok { - - ctx, cancelFn := context.WithCancel(pqm.ctx) + // used the passed in context to FindProvidersAsync for this call + ctx, cancelFn := context.WithCancel(npqm.ctx) requestStatus = &inProgressRequestStatus{ listeners: make(map[chan peer.ID]struct{}), ctx: ctx,