From 336a31838e814eb83a08d2b51b4809f0e11ba393 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 23 Jun 2025 18:51:36 +0000 Subject: [PATCH] ds: flush_write: check {sock} after calling CODE A user callback may call ->close and invalidate {sock} or even replace it, so we must revalidate the {sock} field and break break out of the loop ASAP to ensure we don't attempt further operations on an invalid socket. This really ought to fix the `BUG: ep_mod GLOB=GLOB(...): no such file or directory' (ENOENT) errors on EPOLL_CTL_MOD when a client shuts down TLS on us. Followup-to: f7aaea70 (ds: shutdn_tls_step clobbers {wbuf} early, 2025-06-17) --- lib/PublicInbox/DS.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 901e762b9..f3fdd1d55 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -429,6 +429,7 @@ next_buf: # bref may be enqueueing more CODE to call # (see accept_tls_step) return 0 if (scalar(@$wbuf) > $before); + $sock = $self->{sock} // return; } } # while @$wbuf -- 2.39.5