-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
ALL
-
v4.0
-
Sharding 2018-08-27
-
45
When killSessions is called on a session running a transaction, the transaction is aborted. The command that’s running can return a WriteConflict error that is not labeled with `TransientTransactionError` if the transaction is aborted while a write command is running, causing the thread to throw down the line. I’ve reproduced this with an `update` command in the concurrency suite - if there is a writeConflict caught here, we then check if we’re in a transaction in `handleError()` here . We don’t check if we’ve aborted a transaction though, so we would not throw here in this case, and instead would return the error and not catch the it in writeCommands::run() as we should be doing.
We can also hit the invariant here for the same reason (if the transaction was aborted slightly earlier).
We should check if the transaction was aborted and should also look into if the other places we call `inMultiDocumenTransaction()` need to be changed as well.