querylog: the writer queue defaults to 1024 entries, and a live stream allocates its ring on subscribe instead of at boot

This commit is contained in:
2026-10-21 22:38:53 +02:00
parent 0cafd770c1
commit d951d03b7d
12 changed files with 234 additions and 129 deletions
+4 -2
View File
@@ -72,8 +72,10 @@ pub fn stream(
}
defer if (state.limiter) |limiter| limiter.releaseSse(io, client);
const id = hub.subscribe(io) orelse
return http_util.respondError(request, .service_unavailable, "live stream is full");
const id = hub.subscribe(io) catch |err| return switch (err) {
error.Full => http_util.respondError(request, .service_unavailable, "live stream is full"),
error.OutOfMemory => http_util.respondError(request, .service_unavailable, "no memory for a live stream"),
};
defer hub.unsubscribe(io, id);
var response = try request.http.respondStreaming(&.{}, .{