From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0BC52469719 for ; Mon, 9 Nov 2020 14:10:09 +0300 (MSK) References: <796ca0ba5fe99ec3c0b8370f1d955dc3c8f23bd2.1604706067.git.v.shpilevoy@tarantool.org> From: Serge Petrenko Message-ID: <6813e2e0-0389-31ee-3508-803dcb351621@tarantool.org> Date: Mon, 9 Nov 2020 14:10:07 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [Tarantool-patches] [PATCH 1/1] raft: fix crash in worker fiber List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org 08.11.2020 21:04, Vladislav Shpilevoy пишет: >> 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; > } Hi! Thanks for the patch! LGTM. -- Serge Petrenko