From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 B7B5F469719 for ; Tue, 6 Oct 2020 13:56:18 +0300 (MSK) Date: Tue, 6 Oct 2020 13:56:17 +0300 From: Kirill Yukhin Message-ID: <20201006105617.6lya6ikzuqsjua27@tarantool.org> References: <61072ba98da2e4098b0c35cad83ffcdcbc537c8e.1601644669.git.imun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <61072ba98da2e4098b0c35cad83ffcdcbc537c8e.1601644669.git.imun@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] lua: prohibit fiber yield when GC hook is active List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy Hello, On 02 окт 17:39, Igor Munkin wrote: > While running GC hook (i.e. __gc metamethod) garbage collector engine > is "stopped": the memory penalty threshold is set to LJ_MAX_MEM and > incremental GC step is not triggered as a result. Ergo, yielding the > execution at the finalizer body leads to further running platform with > disabled LuaJIT GC. It is not re-enabled until the yielded fiber doesn't > get the execution back. > > This changeset extends routine with the check whether GC > hook is active. If the switch-over occurs in scope of __gc metamethod > the platform is forced to stop its execution with EXIT_FAILURE and calls > panic routine before the exit. > > Relates to #4518 > Follows up #4727 > > Signed-off-by: Igor Munkin I've checked your patch into 1.10, 2.4, 2.5 and master. -- Regards, Kirill Yukhin