Tarantool development patches archive
 help / color / mirror / Atom feed
From: Ilya Kosarev <i.kosarev@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v5 5/8] refactoring: clear triggers from fresh exceptions
Date: Fri, 22 Nov 2019 05:46:53 +0300	[thread overview]
Message-ID: <dc4cd9c312edafe934f398cdc8460b88b92f9c1a.1574390065.git.i.kosarev@tarantool.org> (raw)
In-Reply-To: <cover.1574390065.git.i.kosarev@tarantool.org>
In-Reply-To: <cover.1574390065.git.i.kosarev@tarantool.org>

Clear triggers from freshly occured exceptions. Trivial replacements:
`diag_raise` by `return -1`, _xc function by it's non _xc version.

Part of #4247
---
 src/box/alter.cc  | 3 ++-
 src/lua/trigger.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/box/alter.cc b/src/box/alter.cc
index 2628e1401..4b3bbca31 100644
--- a/src/box/alter.cc
+++ b/src/box/alter.cc
@@ -5468,7 +5468,8 @@ on_replace_dd_ck_constraint(struct trigger * /* trigger*/, void *event)
 			if (old_def->language == ck_def->language &&
 			    strcmp(old_def->expr_str, ck_def->expr_str) == 0) {
 				old_def->is_enabled = ck_def->is_enabled;
-				trigger_run_xc(&on_alter_space, space);
+				if (trigger_run(&on_alter_space, space) != 0)
+					return -1;
 				return 0;
 			}
 		}
diff --git a/src/lua/trigger.c b/src/lua/trigger.c
index b1473bcc1..d588fc12c 100644
--- a/src/lua/trigger.c
+++ b/src/lua/trigger.c
@@ -79,7 +79,7 @@ lbox_trigger_run(struct trigger *ptr, void *event)
 	if (fiber()->storage.lua.stack == NULL) {
 		L = luaT_newthread(tarantool_L);
 		if (L == NULL)
-			diag_raise();
+			return -1;
 		coro_ref = luaL_ref(tarantool_L, LUA_REGISTRYINDEX);
 	} else {
 		L = fiber()->storage.lua.stack;
-- 
2.17.1

  parent reply	other threads:[~2019-11-22  2:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  2:46 [Tarantool-patches] [PATCH v5 0/8] refactoring: remove exceptions from triggers follow-ups Ilya Kosarev
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 1/8] refactoring: wrap new operator calls in triggers Ilya Kosarev
2019-11-26 15:07   ` Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 2/8] refactoring: specify struct name in allocation diagnostics Ilya Kosarev
2019-11-27 13:25   ` Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 3/8] refactoring: recombine error conditions in triggers Ilya Kosarev
2019-11-27 13:28   ` Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 4/8] refactoring: set diagnostics if sequence_by_id fails Ilya Kosarev
2019-11-27 13:40   ` Sergey Ostanevich
2019-11-22  2:46 ` Ilya Kosarev [this message]
2019-11-27 14:59   ` [Tarantool-patches] [PATCH v5 5/8] refactoring: clear triggers from fresh exceptions Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 6/8] refactoring: update comment for index_def_check_tuple Ilya Kosarev
2019-11-27 14:59   ` Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 7/8] refactoring: remove redundant line in txn_alter_trigger_new Ilya Kosarev
2019-11-27 15:00   ` Sergey Ostanevich
2019-11-22  2:46 ` [Tarantool-patches] [PATCH v5 8/8] refactoring: remove try..catch wrapper around trigger->run Ilya Kosarev
2019-11-27 15:01   ` Sergey Ostanevich
2019-12-02  7:41 ` [Tarantool-patches] [PATCH v5 0/8] refactoring: remove exceptions from triggers follow-ups Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc4cd9c312edafe934f398cdc8460b88b92f9c1a.1574390065.git.i.kosarev@tarantool.org \
    --to=i.kosarev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v5 5/8] refactoring: clear triggers from fresh exceptions' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox