Skip to content

Commit 0d5dd4c

Browse files
committed
Do not use the parent context for the timeout while waiting for in-flight requests to complete in the ingester's TSDB transfer
Signed-off-by: Marco Pracucci <[email protected]>
1 parent f69e011 commit 0d5dd4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/ingester/transfer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ func (i *Ingester) v2TransferOut(ctx context.Context) error {
467467
// requests will be accepted because the "stopped" flag has already been set.
468468
level.Info(util.Logger).Log("msg", "waiting for in-flight write requests to complete")
469469

470-
waitCtx, waitCancel := context.WithTimeout(ctx, 10*time.Second)
470+
// Do not use the parent context cause we don't want to interrupt while waiting
471+
// for in-flight requests to complete if the parent context is cancelled, given
472+
// this logic run only once.
473+
waitCtx, waitCancel := context.WithTimeout(context.Background(), 10*time.Second)
471474
defer waitCancel()
472475

473476
if err := util.WaitGroup(waitCtx, &i.TSDBState.inflightWriteReqs); err != nil {

0 commit comments

Comments
 (0)