Skip to content
Snippets Groups Projects
Commit 1b7f4590 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

gh-793: don't warn if the transaction is rolled back due to exception.

parent e4796b53
No related branches found
No related tags found
No related merge requests found
......@@ -640,22 +640,21 @@ execute_call(lua_State *L, struct request *request, struct obuf *out)
void
box_lua_call(struct request *request, struct obuf *out)
{
auto txn_guard = make_scoped_guard([=] {
struct txn *txn = in_txn();
if (txn) {
say_warn("transaction is active at CALL return");
txn_rollback();
}
});
lua_State *L = NULL;
try {
L = lua_newthread(tarantool_L);
LuarefGuard coro_ref(tarantool_L);
execute_call(L, request, out);
if (in_txn()) {
say_warn("a transaction is active at CALL return");
txn_rollback();
}
} catch (Exception *e) {
txn_rollback();
/* Let all well-behaved exceptions pass through. */
throw;
} catch (...) {
txn_rollback();
/* Convert Lua error to a Tarantool exception. */
tnt_raise(LuajitError, L != NULL ? L : tarantool_L);
}
......
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