Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2023 16:54:17 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Kyle Evans <kevans@freebsd.org>
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:  <ZDlbCSs257NjUKr5@kib.kiev.ua>
In-Reply-To: <CACNAnaFKnvpKFdkEnC=GcKhkc9BXycetCRYA-ySqrCTQurRMWw@mail.gmail.com>
References:  <202304140513.33E5DsXL019547@gitrepo.freebsd.org> <ZDkEF3ODocUAmKQL@kib.kiev.ua> <CACNAnaFKnvpKFdkEnC=GcKhkc9BXycetCRYA-ySqrCTQurRMWw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 14, 2023 at 08:33:42AM -0500, Kyle Evans wrote:
> On Fri, Apr 14, 2023 at 2:43 AM Konstantin Belousov <kostikbel@gmail.com> 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 <ihor@antonovs.family>
> > > AuthorDate: 2023-04-14 05:10:29 +0000
> > > Commit:     Kyle Evans <kevans@FreeBSD.org>
> > > 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZDlbCSs257NjUKr5>