From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2687C1F463; Mon, 25 Nov 2019 08:59:43 +0000 (UTC) Date: Mon, 25 Nov 2019 08:59:43 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH 10/17] daemon: avoid race when quitting workers Message-ID: <20191125085943.GA18781@dcvr> References: <20191124002237.15713-1-e@80x24.org> <20191124002237.15713-11-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191124002237.15713-11-e@80x24.org> List-Id: Eric Wong wrote: > While the master process has a self-pipe to avoid missing > signals, worker processes lack that aside from a pipe to > detect master death. > > That pipe doesn't exist when there's no master process, > so it's possible DS::close never finishes because it > never woke up from epoll_wait. So create a pipe on > the worker_quit signal and force it into epoll/kevent > so it wakes up right away. Nope. A self-pipe in any pure-Perl form is insufficient, since Perl_csighandler() can't wake up processes from any sleeping syscalls (no-internal self-pipe/eventfd like other VMs). Fortunately, Perl exposes sigprocmask, so signalfd should be usable on Linux. EVFILT_SIGNAL also exists for kevent... IO::Poll users might be out-of-luck (anybody try GNU/Hurd?)