From nobody Fri Apr 14 13:54:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PydGn35zKz45J2X; Fri, 14 Apr 2023 13:54:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PydGn03tsz4b3b; Fri, 14 Apr 2023 13:54:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 33EDsHQo067736 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 14 Apr 2023 16:54:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 33EDsHQo067736 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 33EDsHPR067735; Fri, 14 Apr 2023 16:54:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 14 Apr 2023 16:54:17 +0300 From: Konstantin Belousov To: Kyle Evans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8935a3993219 - main - daemon: use kqueue for all events Message-ID: References: <202304140513.33E5DsXL019547@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PydGn03tsz4b3b X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Fri, Apr 14, 2023 at 08:33:42AM -0500, Kyle Evans wrote: > On Fri, Apr 14, 2023 at 2:43 AM Konstantin Belousov wrote: > > > > On Fri, Apr 14, 2023 at 05:13:54AM +0000, Kyle Evans wrote: > > > The branch main has been updated by kevans: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=8935a3993219be76c7ea03e9ad4509657d08af6c > > > > > > commit 8935a3993219be76c7ea03e9ad4509657d08af6c > > > Author: Ihor Antonov > > > AuthorDate: 2023-04-14 05:10:29 +0000 > > > Commit: Kyle Evans > > > CommitDate: 2023-04-14 05:12:21 +0000 > > > > > > daemon: use kqueue for all events > > > > > > Refactor daemon to use kqueue/kevent instead of signals. > > > > > > This changes allows to simplify the code in several ways: > > > - the execution flow is now linear, no async events. > > > - several variables became redundant and got removed. > > > - all event handling is now concentrated inside of the event loop, which > > > makes code reading and comprehension easier. > > > - new kqueuex(2) call is used for CLOEXEC, but maintained closing the > > > kq fd prior to execve() to ease later MFC > > > > > + /* Signals are processed via kqueue */ > > > + signal(SIGHUP, SIG_IGN); > > > + signal(SIGTERM, SIG_IGN); > > Are you sure that this works? When a signal disposition is set to 'ignore', > > the signal delivery drops the signal immediately without queuing/notifying > > the victim. I very much doubt that you would get any kqueue event for HUP > > or TERM after the calls. > > The manpage, at least, specifically calls this out: > > The filter will record all attempts to deliver a > signal to a process, even if the signal has been > marked as SIG_IGN, except for the SIGCHLD signal, > which, if ignored, will not be recorded by the > filter. > > The tests should at least test SIGHUP, maybe not the others. I see, the knote is activated before the signal is dropped. Thanks.