Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] raft: fix crash in worker fiber
Date: Tue, 10 Nov 2020 23:59:56 +0300	[thread overview]
Message-ID: <20201110205956.GA25467@hpalx> (raw)
In-Reply-To: <af131e06-519f-2194-09c3-0a50b0cbe203@tarantool.org>

Hi Vlad, I've checked all results in gitlab-ci, and no new degradations
found [1], patch LGTM.

[1] - https://gitlab.com/tarantool/tarantool/-/pipelines/213343120

On Sun, Nov 08, 2020 at 07:04:09PM +0100, Vladislav Shpilevoy wrote:
> > diff --git a/src/box/raft.c b/src/box/raft.c
> > index e1e60ce94..914b0d68f 100644
> > --- a/src/box/raft.c
> > +++ b/src/box/raft.c
> > @@ -682,11 +682,11 @@ raft_worker_f(va_list args)
> >  			raft_worker_handle_broadcast();
> >  			is_idle = false;
> >  		}
> > +		if (is_idle) {
> > +			assert(raft_is_fully_on_disk());
> > +			fiber_yield();
> > +		}
> >  		fiber_sleep(0);
> > -		if (!is_idle)
> > -			continue;
> > -		assert(raft_is_fully_on_disk());
> > -		fiber_yield();
> >  	}
> >  	return 0;
> 
> I changed this part just a little. Because it makes no sense to
> sleep(0) right after a yield. Force pushed to the branch.
> 
> ====================
> @@ -685,8 +685,9 @@ raft_worker_f(va_list args)
>  		if (is_idle) {
>  			assert(raft_is_fully_on_disk());
>  			fiber_yield();
> +		} else {
> +			fiber_sleep(0);
>  		}
> -		fiber_sleep(0);
>  	}
>  	return 0;
>  }

  parent reply	other threads:[~2020-11-10 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 23:43 Vladislav Shpilevoy
2020-11-08 18:04 ` Vladislav Shpilevoy
2020-11-09 11:10   ` Serge Petrenko
2020-11-10 20:59   ` Alexander V. Tikhonov [this message]
2020-11-10 22:05 ` 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=20201110205956.GA25467@hpalx \
    --to=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] raft: fix crash in worker fiber' \
    /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