https://github.com/mongodb/mongo/blob/55741c6d7ea210cd687cba3891577b830ced48c2/src/mongo/s/transaction_router.cpp#L799
It would be helpful to include the shardId and the current state it was for debugging.