Skip to content

TRANSACTION KILL

Cancels an open transaction of this member.

TRANSACTION KILL id
ArgumentTypeDescription
idintegerTransaction id as listed by TRANSACTION LIST

Simple string: OK on success.

The command cancels the transaction with the given id on this member only. Use TRANSACTION LIST to find the id.

The transaction is not closed. It stays in the TRANSACTION LIST output until its session runs ROLLBACK. That session gets a TRANSACTION_CANCELLED error on its next read or on COMMIT. A write alone does not fail, because writes wait on the client until commit. An auto-commit transaction is closed when its command fails.

Transactions with client_id -1 belong to the member itself. They cannot be killed.

Transaction errors:

Error CodeError messageCause
TRANSACTIONno such transaction: <id>No open transaction has this id
TRANSACTIONinternal transactions cannot be killedThe transaction belongs to the member itself

Kill the transaction of another session:

> TRANSACTION KILL 42
OK

The owner session then sees:

> ZGET key
(error) TRANSACTION_CANCELLED Operation aborted because the transaction was cancelled
> ROLLBACK
OK