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 2/4] dskqxs: ignore EV_SET errors on EVFILT_WRITE
  2020-04-11 10:53  6% [PATCH 0/4] FreeBSD and test fixes Eric Wong
@ 2020-04-11 10:53  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-04-11 10:53 UTC (permalink / raw)
  To: meta

Just like the EPOLL_CTL_ADD emulation path, the EPOLL_CTL_MOD
and EPOLL_CTL_DEL emulation paths can fail if attempting to
install an EVFILT_WRITE for a read-only pipe.

I've only observed this on the EPOLL_CTL_DEL emulation path, but
I suspect it could happen on the EPOLL_CTL_MOD path as well.

Increasing the amount of read-only pipes we rely on with altid
exports via sqlite3 made this old bug more apparent and
reproducible while looping the test suite.

This may be adjusted in the future to deal with write-only
pipes, but we currently don't have any of those watched by
kqueue.
---
 lib/PublicInbox/DSKQXS.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/DSKQXS.pm b/lib/PublicInbox/DSKQXS.pm
index b9b0b6c5..35cdecda 100644
--- a/lib/PublicInbox/DSKQXS.pm
+++ b/lib/PublicInbox/DSKQXS.pm
@@ -105,10 +105,10 @@ sub epoll_ctl {
 	my $kq = $self->{kq};
 	if ($op == EPOLL_CTL_MOD) {
 		$kq->EV_SET($fd, EVFILT_READ, kq_flag(EPOLLIN, $ev));
-		$kq->EV_SET($fd, EVFILT_WRITE, kq_flag(EPOLLOUT, $ev));
+		eval { $kq->EV_SET($fd, EVFILT_WRITE, kq_flag(EPOLLOUT, $ev)) };
 	} elsif ($op == EPOLL_CTL_DEL) {
 		$kq->EV_SET($fd, EVFILT_READ, EV_DISABLE);
-		$kq->EV_SET($fd, EVFILT_WRITE, EV_DISABLE);
+		eval { $kq->EV_SET($fd, EVFILT_WRITE, EV_DISABLE) };
 	} else { # EPOLL_CTL_ADD
 		$kq->EV_SET($fd, EVFILT_READ, EV_ADD|kq_flag(EPOLLIN, $ev));
 

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/4] FreeBSD and test fixes
@ 2020-04-11 10:53  6% Eric Wong
  2020-04-11 10:53  7% ` [PATCH 2/4] dskqxs: ignore EV_SET errors on EVFILT_WRITE Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-04-11 10:53 UTC (permalink / raw)
  To: meta

Looping the tests for hours on end with a FreeBSD 11.2 VM
revealed some problems (and a minor cleanup) I didn't
find on my Debian GNU/Linux systems.

Eric Wong (4):
  testcommon: DESTROY: wait for killed daemon
  dskqxs: ignore EV_SET errors on EVFILT_WRITE
  t/*.t: localize $SIG{__WARN__} changes
  t/httpd-corner.t: relax read-after-failed-write handling

 lib/PublicInbox/DSKQXS.pm     |  4 ++--
 lib/PublicInbox/TestCommon.pm |  6 +++---
 lib/PublicInbox/Xapcmd.pm     |  6 +++++-
 t/httpd-corner.t              | 39 +++++++++++++++++++++--------------
 t/mda_filter_rubylang.t       |  2 +-
 t/nntpd.t                     |  2 +-
 t/watch_filter_rubylang.t     |  2 +-
 7 files changed, 36 insertions(+), 25 deletions(-)

^ 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 --
2020-04-11 10:53  6% [PATCH 0/4] FreeBSD and test fixes Eric Wong
2020-04-11 10:53  7% ` [PATCH 2/4] dskqxs: ignore EV_SET errors on EVFILT_WRITE 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).