Skip to content

Commit 9696918

Browse files
committed
add recommended comment
1 parent 2fd17ef commit 9696918

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

x/mongo/driver/topology/pool.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,13 @@ func (p *pool) checkOut(ctx context.Context) (conn *connection, err error) {
503503
}
504504
return nil, ErrPoolClosed
505505
case poolPaused:
506+
// Wrap poolCleared in a driver.Error so we can add the
507+
// "TransientTransactionError" label. This will add
508+
// "TransientTransactionError" to all poolClearedError instances, not
509+
// just those that happened during transactions. While that behavior is
510+
// different than other places we add "TransientTransactionError", it is
511+
// consistent with the Transactions specification and simplifies the
512+
// code.
506513
pcErr := poolClearedError{err: p.lastClearErr, address: p.address}
507514
err := driver.Error{
508515
Message: pcErr.Error(),

0 commit comments

Comments
 (0)