Skip to content
Snippets Groups Projects
Commit a76eb6ef authored by mechanik20051988's avatar mechanik20051988 Committed by Nikita Pettik
Browse files

txn: implement timeout for transactions

Client code errors or manual mistakes can create transactions that are
never closed. Such transaction will work as a memory leak. Implement
timeout for transactions after which they are rolled back.

Part of #6177

@TarantoolBot document
Title: ability to set timeout for transactions was implemented
Previously transactions are never closed until commit or rollback.
Timeout for transactions was implemented after which they are rolled
back. For these purpose, in `box.begin` the optional table parameter
was added. For example if user want to start transaction with timeout
3s, he should use `box.begin({timeout = 3})`. Also was implement new
configuration option `box.cfg.txn_timeout` which determines timeout for
transactions, for which the timeout was not explicitly set. By default
this option is set to infinity (TIMEOUT_INFINITY = 365 * 100 * 86400).
Also in C API was added new function to set timeout for transaction -
'box_txn_set_timeout'.
parent 9c5d3ed7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment