From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (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 9B676469719 for ; Wed, 18 Mar 2020 11:26:12 +0300 (MSK) Received: by mail-lf1-f66.google.com with SMTP id n20so16224047lfl.10 for ; Wed, 18 Mar 2020 01:26:12 -0700 (PDT) Date: Wed, 18 Mar 2020 11:26:10 +0300 From: Konstantin Osipov Message-ID: <20200318082610.GA26019@atlas> References: <0e7fddec984120e36c098cd546ecae4fddc726cd.1577346185.git.lvasiliev@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0e7fddec984120e36c098cd546ecae4fddc726cd.1577346185.git.lvasiliev@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2] Add some cancellation guard List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Vasiliev Cc: tarantool-patches@dev.tarantool.org * Leonid Vasiliev [19/12/26 10:51]: > We need to set a thread cancellation guard, because > another thread may cancel the current thread at a > really bad time (messages flush, mutex lock) > > Fixes: #4127 I think we have to do this patch, as long as we use pthread_cancel(). An alternative is to ignore the bug. There is no harm in Tarantool in crashing at exit, as long as we close the wal first. And we should close the wal first! AFAIU pthread_setcancellable is a thread-local and cheap operation. Could you please confirm this? (I haven't studied the pthread implementation code since 2001, when Linux only had Xavier Leroy's threads). -- Konstantin Osipov, Moscow, Russia