From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 62044469719 for ; Wed, 14 Oct 2020 16:29:43 +0300 (MSK) Received: by mail-lf1-f65.google.com with SMTP id d24so3672056lfa.8 for ; Wed, 14 Oct 2020 06:29:43 -0700 (PDT) Date: Wed, 14 Oct 2020 16:29:39 +0300 From: Cyrill Gorcunov Message-ID: <20201014132939.GA173841@grain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 2/6] raft: factor out the code to wakeup worker fiber List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Wed, Oct 14, 2020 at 01:28:28AM +0200, Vladislav Shpilevoy wrote: > -raft_schedule_broadcast(void) > +raft_worker_wakeup(void) > { > - raft.is_broadcast_scheduled = true; > + if (raft.worker == NULL) { > + raft.worker = fiber_new("raft_worker", raft_worker_f); > + fiber_set_joinable(raft.worker, true); > + } When fiber_new return NULL you'll get nil dereference in fiber_set_joinable.