Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH] box: ensure fiber processing box.cfg doesn't process messages from iproto
Date: Tue, 13 Nov 2018 09:54:40 +0300	[thread overview]
Message-ID: <38805B24-8BC1-40C1-9C6B-18A7DD3F9EFB@tarantool.org> (raw)
In-Reply-To: <20181112114033.srhds7nlbmq7oogq@esperanza>

Hi!

12 нояб. 2018 г., в 14:40, Vladimir Davydov <vdavydov.dev@gmail.com> написал(а):
> 
> On Sat, Nov 10, 2018 at 02:24:36PM +0300, Serge Petrenko wrote:
>> 
>> diff --git a/src/box/gc.c b/src/box/gc.c
>> index 467eecb91..8f0ecb0b9 100644
>> --- a/src/box/gc.c
>> +++ b/src/box/gc.c
>> @@ -110,7 +110,7 @@ void
>> gc_set_wal_watcher(void)
>> {
> 
> Please add a comment to the code, otherwise the patch looks OK.

Added the comment, the diff’s below.

> 
>> 	wal_set_watcher(&gc.wal_watcher, "tx", gc_process_wal_event,
>> -			cbus_process, WAL_EVENT_GC);
>> +			NULL, WAL_EVENT_GC);
>> }
>> 
>> void


diff --git a/src/box/gc.c b/src/box/gc.c
index 467eecb91..cefe1553f 100644
--- a/src/box/gc.c
+++ b/src/box/gc.c
@@ -109,8 +109,18 @@ gc_process_wal_event(struct wal_watcher_msg *);
 void
 gc_set_wal_watcher(void)
 {
+	/*
+	 * Since the function is called from box_cfg() it is
+	 * important that we do not pass a message processing
+	 * callback to wal_set_watcher(). Doing so would cause
+	 * credentials corruption in the fiber executing
+	 * box_cfg() in case it processes some iproto messages.
+	 * Besides, by the time the function is called
+	 * tx_fiber_pool is already set up and it will process
+	 * all the messages directed to "tx" endpoint safely.
+	 */
 	wal_set_watcher(&gc.wal_watcher, "tx", gc_process_wal_event,
-			cbus_process, WAL_EVENT_GC);
+			NULL, WAL_EVENT_GC);
 }
 
 void
-- 
2.17.2 (Apple Git-113)

  reply	other threads:[~2018-11-13  6:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-10 11:24 Serge Petrenko
2018-11-12 11:40 ` Vladimir Davydov
2018-11-13  6:54   ` Serge Petrenko [this message]
2018-11-13  9:31     ` Vladimir Davydov

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=38805B24-8BC1-40C1-9C6B-18A7DD3F9EFB@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH] box: ensure fiber processing box.cfg doesn'\''t process messages from iproto' \
    /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