szn

Bug 373 — EAGAIN treated as fatal on display client reads

373. Transient WouldBlock tears down healthy connections

File: src/server/server.zig:2231-2237; caller run() at 604-608 Severity: MEDIUM Status: ✅ FIXED

Fix (applied)

handleClient now maps error.WouldBlock to a benign no-op return; only real read failures propagate as error.ReadFailed and tear the client down.

Test: handleClient tolerates EAGAIN on non-blocking fd — bug #373 (non-blocking pipe with a registered MessageReader; handleClient must return without error).

Problem

const n = std.posix.read(fd, &buf) catch |err| {
    ...
    return error.ReadFailed;   // → removeClient(cfd)

registerDisplayClient flips the socket to non-blocking; on any spurious wake or edge race the read returns WouldBlock and the whole DisplayClient is destroyed instead of waiting for the next POLLIN.

Fix (proposed)

Map error.WouldBlock to a benign zero-progress return in handleClient; propagate only real errors as disconnects.