From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: [PATCH] box: ensure fiber processing box.cfg doesn't process messages from iproto From: Serge Petrenko In-Reply-To: <20181112114033.srhds7nlbmq7oogq@esperanza> Date: Tue, 13 Nov 2018 09:54:40 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <38805B24-8BC1-40C1-9C6B-18A7DD3F9EFB@tarantool.org> References: <20181110112436.1118-1-sergepetrenko@tarantool.org> <20181112114033.srhds7nlbmq7oogq@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: Hi! 12 =D0=BD=D0=BE=D1=8F=D0=B1. 2018 =D0=B3., =D0=B2 14:40, Vladimir = Davydov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB= (=D0=B0): >=20 > On Sat, Nov 10, 2018 at 02:24:36PM +0300, Serge Petrenko wrote: >>=20 >> 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) >> { >=20 > Please add a comment to the code, otherwise the patch looks OK. Added the comment, the diff=E2=80=99s below. >=20 >> wal_set_watcher(&gc.wal_watcher, "tx", gc_process_wal_event, >> - cbus_process, WAL_EVENT_GC); >> + NULL, WAL_EVENT_GC); >> } >>=20 >> 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); } =20 void --=20 2.17.2 (Apple Git-113)