mirror of https://github.com/sbt/sbt.git
NetworkChannel batches writes to the client at most once per 20ms to reduce terminal flicker and byte volume. forceFlush(), used to order buffered stdout ahead of a control-plane message, called flushExecutor.shutdownNow() -- the only place the executor was ever shut down. Once it ran during active output it tore the executor down (and, if a coalesced flush was pending, cancelled its future without resetting flushFuture, leaving the slot stuck), so the 20ms coalescing was gone for the rest of the connection: stdout was then flushed per write via the inline fallback instead of batched. Output still reaches the client, so the effect is extra flushes rather than lost output, but shutting the shared executor down on the first forceFlush is clearly unintended. Extract the flush state machine into CoalescingFlusher. forceFlush now drains immediately and leaves the timer live (a pending coalesced drain harmlessly drains the remainder when it fires); the executor is shut down once, at channel teardown, so it no longer leaks. doFlush now holds a lock across both the drain and the publish so an inline forceFlush and the timer's drain can't deliver two stdout batches out of order. Fixes #9415 Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 1.0.0 | ||
| 1.0.3 | ||
| 1.1.2 | ||
| 1.1.4 | ||
| 1.1.5 | ||
| 1.2.0 | ||
| 1.3.0 | ||
| 1.6.0 | ||
| 1.7.0 | ||
| 1.8.0 | ||
| 2.0.0 | ||
| 0.10.0.markdown | ||
| 0.10.1.markdown | ||
| 0.11.0.markdown | ||
| 0.11.3.markdown | ||
| 0.13.6.markdown | ||
| 0.13.7.markdown | ||
| 0.13.8.markdown | ||
| 0.13.9.markdown | ||
| 0.13.11.markdown | ||
| 0.13.12.markdown | ||
| 0.13.13.markdown | ||
| 0.13.14.markdown | ||
| 0.13.16.markdown | ||
| 1.0.0.markdown | ||
| 1.0.1.markdown | ||
| 1.0.2.markdown | ||
| 1.0.3.markdown | ||
| 1.0.4.markdown | ||
| 1.1.0.markdown | ||
| 1.1.1.markdown | ||
| about.markdown | ||
| sample.md | ||