Commits
Tarun Sukhani authored c63194758ae
fix(server): bound SSE/chunked write queue with backpressure (PF-134) LazyChunkedInput.nextChunks was an unbounded ConcurrentLinkedQueue: a producer outpacing a slow client (canonical SSE failure) grew it without limit, with no channel.isWritable()/watermark check anywhere in the writeChunk path. - Bound the queue by queued bytes (8 MiB high / 4 MiB low watermark with hysteresis). When over HIGH, the writing virtual thread parks until the IO thread drains below LOW; cheap on VTs under JEP 491. Parking is gated on !inEventLoop() so a raw-plugin write from channelRead can never block the event loop that drains the queue (would deadlock). On close while parked, the writer throws so SseStream's close-on-failure path fires. - readChunk now wraps the byte[] zero-copy (Unpooled.wrappedBuffer) instead of allocating + copying a fresh buffer per chunk; the array is never mutated after enqueue. - closed is now volatile (written by invoker VT, read by IO thread). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit 80853cedb687d05c9d16f27fe886ec0eaccb5b6b)