Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-70247

SyncTransactionWithRetries used with SEPTransactionClient can leave transactions open when runNoThrow opCtx gets cancelled

    • Fully Compatible
    • ALL
    • Sharding 2022-10-17, Sharding NYC 2022-10-31, Sharding NYC 2022-11-14

      Sequence of events:

      1. SyncTransactionWithRetries::runNoThrow gets called
      2. Waits for the transaction callback to finish here, but opCtx was cancelled so proceed to call cancel on the cancellation token
      3. If the transaction hasn't finished, it will try to abort it. But since it is using the client's runCommand to run abort, it will fail because it will try to use the token that was already cancelled to create the new opCtx for the abort command
      4. Transaction that was started at the beginning is just left in idle state.

            jason.zhang@mongodb.com Jason Zhang
            randolph@mongodb.com Randolph Tan
            0 Vote for this issue
            3 Start watching this issue