From 06ec88bc7986ca6bb7a9c35fa1b86056371069a2 Mon Sep 17 00:00:00 2001 From: Preston Vasquez <24281431+prestonvasquez@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:25:45 -0600 Subject: [PATCH] GODRIVER-2997 Prevent user-defined context from canceling in txn commit loop --- mongo/session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongo/session.go b/mongo/session.go index 22aa026c9e..8f1e029b95 100644 --- a/mongo/session.go +++ b/mongo/session.go @@ -233,7 +233,7 @@ func (s *sessionImpl) WithTransaction(ctx context.Context, fn func(ctx SessionCo CommitLoop: for { - err = s.CommitTransaction(ctx) + err = s.CommitTransaction(newBackgroundContext(ctx)) // End when error is nil, as transaction has been committed. if err == nil { return res, nil