From 7593655fe3e9ec115e4ec3b1b6fbc15a96e88afc Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Sat, 1 Aug 2026 13:12:52 -0500 Subject: [PATCH] subscriber: connect on the io that reads the socket DNS + TCP connect ran on pool_io while TLS + WebSocket reads ran on self.io. That split dates to the Evented attempt, where Io.Uring had no netLookup. Under Threaded both are the same backend, so it is a no-op today; under any evented backend it hands the reader an fd created in another domain -- a blocking fd read from a fiber. Removes an Evented-era vestige and unblocks a zio evaluation. No behavioral change on the current backend. 107 pass, 1 skip. Co-Authored-By: Claude Opus 5 (1M context) --- src/internal/subscriber.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/internal/subscriber.zig b/src/internal/subscriber.zig index 178e0e9..2b195d6 100644 --- a/src/internal/subscriber.zig +++ b/src/internal/subscriber.zig @@ -310,16 +310,21 @@ pub const Subscriber = struct { } const path = w.buffered(); - // DNS + TCP connect through pool_io (Threaded — has working netLookup). - // The resulting fd is used by the Evented io for TLS + WebSocket I/O. + // Connect on the same io that will read the socket. The old split — + // DNS + connect on pool_io, then TLS + WebSocket on self.io — existed + // because Io.Uring never implemented netLookup. Under Threaded both + // are the same backend, so it was a no-op; under any evented backend + // it hands a foreign-domain fd to the reader, which is a defect (a + // blocking fd read from a fiber). Backends that lack netLookup are + // expected to delegate it, not to have callers route around them. + // // each phase labels its catch site so operators can see which layer // is failing across the fleet via relay_subscriber_disconnect_total. - const dns_io = self.pool_io orelse self.io; const host_name = Io.net.HostName.init(self.options.hostname) catch |e| { _ = self.bc.stats.subscriber_disconnect_dns_connect.fetchAdd(1, .monotonic); return e; }; - const net_stream = host_name.connect(dns_io, 443, .{ .mode = .stream }) catch |e| { + const net_stream = host_name.connect(self.io, 443, .{ .mode = .stream }) catch |e| { _ = self.bc.stats.subscriber_disconnect_dns_connect.fetchAdd(1, .monotonic); return e; }; -- 2.51.2