From nobody Fri Apr 14 07:43:19 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 4PyT2s0BZ7z44hmF; Fri, 14 Apr 2023 07:43:33 +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 4PyT2r2dylz4QQZ; Fri, 14 Apr 2023 07:43:32 +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 33E7hJ2t075445 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 14 Apr 2023 10:43:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 33E7hJ2t075445 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 33E7hJj5075444; Fri, 14 Apr 2023 10:43:19 +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 10:43:19 +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=us-ascii Content-Disposition: inline In-Reply-To: <202304140513.33E5DsXL019547@gitrepo.freebsd.org> 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: 4PyT2r2dylz4QQZ 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 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.