Severity: MEDIUM-HIGH Status: Fixed
The per-frame render path appends the serialized frame directly to the display client’s output buffer, never calling appendClientOut() (which implements the high-watermark backpressure and diagnostic counters):
// src/server/server.zig:3141-3154
const pkt = protocol.Packet.make(.output, self.render_buf.items);
var hdr: [5]u8 = undefined;
pkt.header.encode(&hdr);
const prev_len = dc.out_buf.items.len;
var append_ok = true;
dc.out_buf.appendSlice(self.allocator, hdr[0..]) catch { append_ok = false; };
if (append_ok) {
dc.out_buf.appendSlice(self.allocator, self.render_buf.items) catch {
dc.out_buf.shrinkRetainingCapacity(prev_len);
append_ok = false;
};
}
// src/server/server.zig:2735 — the path that IS bypassed
fn appendClientOut(self: *Server, dc: *DisplayClient, data: []const u8) bool {
// ... RENDER_HIGH_WATERMARK check + diagnostic counters ...
}
appendClientOut (see bug #298 flow-control test) enforces RENDER_HIGH_WATERMARK; the render path skips it entirely.dc.out_buf grow without bound across frames → memory pressure / OOM of the server, and the watermark diagnostic counters stay zero for render traffic, hiding the problem.Route render frames through appendClientOut() (or replicate its watermark check) so render output participates in the same backpressure as other display traffic. On watermark exceed, skip the frame (or mark all_flushed = false) instead of unconditionally appending.