[PATCH] box: ensure fiber processing box.cfg doesn't process messages from iproto

Vladimir Davydov vdavydov.dev at gmail.com
Tue Nov 13 12:31:11 MSK 2018


On Tue, Nov 13, 2018 at 09:54:40AM +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.

Pushed to 1.10-features.

> 
> > 
> >> 	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);



More information about the Tarantool-patches mailing list