Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 12/20] net.box: rewrite error decoder in C
Date: Mon, 2 Aug 2021 11:00:22 +0300	[thread overview]
Message-ID: <20210802080022.lw2pjqjoiitliqmf@esperanza> (raw)
In-Reply-To: <a823c8d2-ffa7-5f9f-5405-c1029fe3d0b5@tarantool.org>

On Sat, Jul 31, 2021 at 12:13:15AM +0200, Vladislav Shpilevoy wrote:
> > +		mp_next(data); /* skip value */
> 
> 1. Could you please write comments on their own lines if possible?

Done.

> > -ffi.cdef[[
> > -struct error *
> > -error_unpack_unsafe(const char **data);
> 
> 2. You should be able to remove it from exports.h now. It
> is not used by FFI anymore. (error_unref() should stay in
> export.h - it is used by error Lua module.)

Done.

> > -local response_decoder = {
> > -    [IPROTO_ERROR_24] = decode,
> > -    [IPROTO_ERROR] = decode_error,
> 
> 3. IPROTO_ERROR is now unused.

Removed.

Pushed all the changes to the branch and rebased.
The incremental diff is below:
--
diff --git a/src/box/lua/net_box.c b/src/box/lua/net_box.c
index 0914697f2b2e..e1f820926838 100644
--- a/src/box/lua/net_box.c
+++ b/src/box/lua/net_box.c
@@ -1051,7 +1051,7 @@ netbox_decode_method(struct lua_State *L)
 	return 2;
 }
 
-/*
+/**
  * Decodes an error from raw data and pushes it to Lua stack. Takes a pointer
  * to the data (char ptr) and an error code.
  */
@@ -1092,7 +1092,8 @@ netbox_decode_error(struct lua_State *L)
 			error_ref(error);
 			continue;
 		}
-		mp_next(data); /* skip value */
+		/* Skip value. */
+		mp_next(data);
 	}
 	if (error == NULL) {
 		/*
diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index c0c3c4098525..242b1c8d9314 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -41,7 +41,6 @@ local IPROTO_SYNC_KEY      = 0x01
 local IPROTO_SCHEMA_VERSION_KEY = 0x05
 local IPROTO_DATA_KEY      = 0x30
 local IPROTO_ERROR_24      = 0x31
-local IPROTO_ERROR         = 0x52
 local IPROTO_GREETING_SIZE = 128
 local IPROTO_CHUNK_KEY     = 128
 local IPROTO_OK_KEY        = 0
diff --git a/src/exports.h b/src/exports.h
index 5bb3e6a2b55a..7be6486f0075 100644
--- a/src/exports.h
+++ b/src/exports.h
@@ -220,7 +220,6 @@ EXPORT(curl_version_info)
 EXPORT(decimal_unpack)
 EXPORT(error_ref)
 EXPORT(error_set_prev)
-EXPORT(error_unpack_unsafe)
 EXPORT(error_unref)
 EXPORT(exception_get_int)
 EXPORT(exception_get_string)

  reply	other threads:[~2021-08-02  8:00 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 11:07 [Tarantool-patches] [PATCH 00/20] Rewrite performance critical parts of net.box " Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 01/20] net.box: fix console connection breakage when request is discarded Vladimir Davydov via Tarantool-patches
2021-07-28 22:49   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 10:40     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 02/20] net.box: wake up wait_result callers " Vladimir Davydov via Tarantool-patches
2021-07-29 10:47   ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 03/20] net.box: do not check worker_fiber in request:result, is_ready Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 04/20] net.box: remove decode_push from method_decoder table Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 05/20] net.box: use decode_tuple instead of decode_get Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 06/20] net.box: rename request.ctx to request.format Vladimir Davydov via Tarantool-patches
2021-07-28 22:49   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 10:54     ` Vladimir Davydov via Tarantool-patches
2021-07-29 22:39       ` Vladislav Shpilevoy via Tarantool-patches
2021-07-30  8:15         ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 07/20] net.box: use integer id instead of method name Vladimir Davydov via Tarantool-patches
2021-07-28 22:50   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:30     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 08/20] net.box: remove useless encode optimization Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 09/20] net.box: rewrite request encoder in C Vladimir Davydov via Tarantool-patches
2021-07-28 22:51   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 14:08     ` Vladimir Davydov via Tarantool-patches
2021-07-29 14:10       ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 10/20] lua/utils: make char ptr Lua CTIDs public Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 11/20] net.box: rewrite response decoder in C Vladimir Davydov via Tarantool-patches
2021-07-27 14:07   ` Cyrill Gorcunov via Tarantool-patches
2021-07-27 14:14     ` Vladimir Davydov via Tarantool-patches
2021-07-29 22:39   ` Vladislav Shpilevoy via Tarantool-patches
2021-07-30  8:44     ` Vladimir Davydov via Tarantool-patches
2021-07-30 22:12       ` Vladislav Shpilevoy via Tarantool-patches
2021-08-02  7:36         ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 12/20] net.box: rewrite error " Vladimir Davydov via Tarantool-patches
2021-07-30 22:13   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-02  8:00     ` Vladimir Davydov via Tarantool-patches [this message]
2021-08-02 21:47       ` Vladislav Shpilevoy via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 13/20] net.box: rewrite send_and_recv_{iproto, console} " Vladimir Davydov via Tarantool-patches
2021-08-02 21:49   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-03 15:44     ` Vladimir Davydov via Tarantool-patches
2021-08-03 23:06       ` Vladislav Shpilevoy via Tarantool-patches
2021-08-04 13:56         ` Vladimir Davydov via Tarantool-patches
2021-08-04 21:18           ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05  8:37             ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 14/20] net.box: rename netbox_{prepare, encode}_request to {begin, end} Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 15/20] net.box: rewrite request implementation in C Vladimir Davydov via Tarantool-patches
2021-08-02 21:54   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-04 12:30     ` Vladimir Davydov via Tarantool-patches
2021-08-04 15:35       ` Vladimir Davydov via Tarantool-patches
2021-08-04 16:14         ` Vladimir Davydov via Tarantool-patches
2021-08-04 21:20       ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05 12:46         ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 16/20] net.box: store next_request_id in C code Vladimir Davydov via Tarantool-patches
2021-08-03 23:06   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-04 16:25     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 17/20] net.box: rewrite console handlers in C Vladimir Davydov via Tarantool-patches
2021-08-03 23:07   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05 11:53     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 18/20] net.box: rewrite iproto " Vladimir Davydov via Tarantool-patches
2021-08-03 23:08   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05 11:54     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 19/20] net.box: merge new_id, new_request and encode_method Vladimir Davydov via Tarantool-patches
2021-08-03 23:08   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05 11:55     ` Vladimir Davydov via Tarantool-patches
2021-07-23 11:07 ` [Tarantool-patches] [PATCH 20/20] net.box: do not create request object in Lua for sync requests Vladimir Davydov via Tarantool-patches
2021-08-03 23:09   ` Vladislav Shpilevoy via Tarantool-patches
2021-08-05 12:23     ` Vladimir Davydov via Tarantool-patches
2021-07-23 12:48 ` [Tarantool-patches] [PATCH 00/20] Rewrite performance critical parts of net.box in C Vladimir Davydov via Tarantool-patches
2021-07-26  7:26 ` Kirill Yukhin via Tarantool-patches
2021-07-27  9:59   ` Vladimir Davydov via Tarantool-patches
2021-07-28 22:51 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:33   ` Vladimir Davydov via Tarantool-patches
2021-07-29 15:23     ` Vladimir Davydov via Tarantool-patches
2021-07-29 22:38       ` Vladislav Shpilevoy via Tarantool-patches
2021-07-30 10:04         ` Vladimir Davydov via Tarantool-patches
2021-07-29 22:40 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-30  8:16   ` Vladimir Davydov via Tarantool-patches
2021-08-03 23:05 ` Vladislav Shpilevoy via Tarantool-patches
2021-08-04 12:40   ` Vladimir Davydov via Tarantool-patches
2021-08-05 20:59 ` Vladislav Shpilevoy via Tarantool-patches
2021-08-09 11:22 ` Igor Munkin via Tarantool-patches
2021-08-09 11:48   ` Vitaliia Ioffe via Tarantool-patches
2021-08-09 13:56     ` Vladimir Davydov via Tarantool-patches

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=20210802080022.lw2pjqjoiitliqmf@esperanza \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --cc=vdavydov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 12/20] net.box: rewrite error decoder in C' \
    /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