user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 6/7] ds: use constants for @UNBLOCKABLE list
  2023-09-11  9:41  6% [PATCH 0/7] system-related updates and cleanups Eric Wong
@ 2023-09-11  9:41  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-09-11  9:41 UTC (permalink / raw)
  To: meta

There's no need for for a complicated map {} block here.  All
these unblockable signals are POSIX since 2001 at the latest, so
there's no reason any platform would lack them.
---
 lib/PublicInbox/DS.pm | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index f2b14799..b3edc094 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -186,11 +186,9 @@ sub RunTimers {
 
 sub sig_setmask { sigprocmask(SIG_SETMASK, @_) or die "sigprocmask: $!" }
 
-our @UNBLOCKABLE = map { # ensure we detect bugs, HW problems and user rlimits
-	my $cb = POSIX->can("SIG$_");
-	my $num = $cb ? $cb->() : undef;
-	$num ? ($num) : ();
-} qw(ABRT BUS FPE ILL SEGV XCPU XFSZ);
+# ensure we detect bugs, HW problems and user rlimits
+our @UNBLOCKABLE = (POSIX::SIGABRT, POSIX::SIGBUS, POSIX::SIGFPE,
+	POSIX::SIGILL, POSIX::SIGSEGV, POSIX::SIGXCPU, POSIX::SIGXFSZ);
 
 sub block_signals { # anything in @_ stays unblocked
 	my $newset = POSIX::SigSet->new;

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/7] system-related updates and cleanups
@ 2023-09-11  9:41  6% Eric Wong
  2023-09-11  9:41  7% ` [PATCH 6/7] ds: use constants for @UNBLOCKABLE list Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-09-11  9:41 UTC (permalink / raw)
  To: meta

2/7 is a very welcome cleanup... I'm liking the `awaitpid' API
quite a bit :>  I noticed the bug fixed by 1/7 while working
on 2/7.

3/7 is a welcome cleanup, though 4/7 is debatable...
IMHO epoll is total overkill for processes which will never
see many FDs and can't benefit from EPOLLEXCLUSIVE.

5/7 helps me sleep better at night since I'm uncomfortable
with using undocumented APIs

And a couple of further signal blocking cleanups.

Eric Wong (7):
  tests: map CLOFORK->FD_CLOEXEC temporarily for `tail -f'
  daemon: depend on DS event_loop in master process, too
  ds: use object-oriented API for epoll
  favor poll(2) for most daemons
  dspoll: switch to the documented IO::Poll API
  ds: use constants for @UNBLOCKABLE list
  spawn: do not block ABRT/BUS/ILL/SEGV signals

 MANIFEST                      |   1 +
 lib/PublicInbox/DS.pm         |  60 ++++----
 lib/PublicInbox/DSKQXS.pm     |  58 ++++----
 lib/PublicInbox/DSPoll.pm     |  64 ++++-----
 lib/PublicInbox/Daemon.pm     | 254 ++++++++++++++++------------------
 lib/PublicInbox/Epoll.pm      |  23 +++
 lib/PublicInbox/Sigfd.pm      |  12 +-
 lib/PublicInbox/Spawn.pm      |  11 +-
 lib/PublicInbox/SpawnPP.pm    |   4 +
 lib/PublicInbox/Syscall.pm    |  12 +-
 lib/PublicInbox/TestCommon.pm |  43 +++++-
 t/ds-kqxs.t                   |   4 +-
 t/ds-poll.t                   |  29 ++--
 t/epoll.t                     |  23 ++-
 t/httpd-unix.t                |  21 ++-
 t/lei-daemon.t                |   1 +
 t/sigfd.t                     |   4 +-
 t/watch_maildir.t             |   1 +
 t/xap_helper.t                |   7 +-
 19 files changed, 323 insertions(+), 309 deletions(-)
 create mode 100644 lib/PublicInbox/Epoll.pm


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-09-11  9:41  6% [PATCH 0/7] system-related updates and cleanups Eric Wong
2023-09-11  9:41  7% ` [PATCH 6/7] ds: use constants for @UNBLOCKABLE list Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).