From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Leonid Vasiliev <lvasiliev@tarantool.org>,
alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH V5 5/6] error: update constructors of some errors
Date: Sat, 18 Apr 2020 22:39:59 +0200 [thread overview]
Message-ID: <ca8a6f7f-ab3d-4ac5-7240-3150936b7b8a@tarantool.org> (raw)
In-Reply-To: <f07109c6dcfdc331c139ea899a5cf98e8ef9f123.1587223627.git.lvasiliev@tarantool.org>
Thanks for the patch!
On 18/04/2020 17:29, Leonid Vasiliev wrote:
> We want to have a transparent marshalling through net.box
> for errors. To do this, we need to recreate the error
> on the client side with the same parameters as on the server.
> For convenience, we update AccessDeniedError constructor
> which has points to static strings and add the XlogGapError
I force pushed 'points' -> 'pointers'.
> constructor that does not require vclock.
>
> Needed for #4398
> ---
> src/box/error.cc | 25 ++++++++++++++-----------
> src/box/error.h | 11 ++++++++---
> 2 files changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/src/box/error.cc b/src/box/error.cc
> index 277727d..0d2ba83 100644
> --- a/src/box/error.cc
> +++ b/src/box/error.cc
> @@ -283,23 +290,19 @@ AccessDeniedError::AccessDeniedError(const char *file, unsigned int line,
> const char *access_type,
> const char *object_type,
> const char *object_name,
> - const char *user_name)
> + const char *user_name,
> + bool run_trigers)
> :ClientError(&type_AccessDeniedError, file, line, ER_ACCESS_DENIED)
> {
> error_format_msg(this, tnt_errcode_desc(m_errcode),
> access_type, object_type, object_name, user_name);
>
> struct on_access_denied_ctx ctx = {access_type, object_type, object_name};
> - trigger_run(&on_access_denied, (void *) &ctx);
> - /*
> - * We want to use ctx parameters as error parameters
> - * later, so we have to alloc space for it.
> - * As m_access_type and m_object_type are constant
> - * literals they are statically allocated. We must copy
> - * only m_object_name.
> - */
> - m_object_type = object_type;
> - m_access_type = access_type;
> + /* Don't run the triggers when create after marshaling through net */
I force pushed the following diff:
====================
diff --git a/src/box/error.cc b/src/box/error.cc
index 0d2ba83b7..c3c2af3ab 100644
--- a/src/box/error.cc
+++ b/src/box/error.cc
@@ -298,7 +298,10 @@ AccessDeniedError::AccessDeniedError(const char *file, unsigned int line,
access_type, object_type, object_name, user_name);
struct on_access_denied_ctx ctx = {access_type, object_type, object_name};
- /* Don't run the triggers when create after marshaling through net */
+ /*
+ * Don't run the triggers when create after marshaling
+ * through network.
+ */
if (run_trigers)
trigger_run(&on_access_denied, (void *) &ctx);
m_object_type = strdup(object_type);
====================
next prev parent reply other threads:[~2020-04-18 20:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-18 15:29 [Tarantool-patches] [PATCH V5 0/6] Extending error functionality Leonid Vasiliev
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 1/6] error: add custom error type Leonid Vasiliev
2020-04-18 18:52 ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 2/6] error: send custom type in IProto Leonid Vasiliev
2020-04-18 20:39 ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 3/6] session: add offset to SQL session settings array Leonid Vasiliev
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 4/6] error: add session setting for error type marshaling Leonid Vasiliev
2020-04-18 20:40 ` Vladislav Shpilevoy
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 5/6] error: update constructors of some errors Leonid Vasiliev
2020-04-18 20:39 ` Vladislav Shpilevoy [this message]
2020-04-18 15:29 ` [Tarantool-patches] [PATCH V5 6/6] error: add error MsgPack encoding Leonid Vasiliev
2020-04-18 20:39 ` Vladislav Shpilevoy
2020-04-18 21:14 ` [Tarantool-patches] [PATCH V5 5.5/6] box: move Lua MP_EXT decoder from tuple.c Vladislav Shpilevoy
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=ca8a6f7f-ab3d-4ac5-7240-3150936b7b8a@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=alexander.turenko@tarantool.org \
--cc=lvasiliev@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH V5 5/6] error: update constructors of some errors' \
/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