sbt/notes/2.0.0
BrianHotopp b11adb6a88
[2.x] fix: Keep the output-flush timer alive across forceFlush (#9414)
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>
2026-07-10 14:15:32 -04:00
..
boot-socket-liveness.md [2.x] fix: Probe for a live server before refusing to start (#9337) 2026-07-01 17:02:50 -04:00
cache-version.md [2.x] feat: Add cacheVersion setting for global cache invalidation (#8993) 2026-04-01 11:23:10 +09:00
dependency-tree-dedup.md [2.x] fix: Collapse duplicate subtrees in dependency tree rendering (#9226) 2026-05-18 19:15:47 -04:00
migration.md [sbt 2.x] remote cache (#7464) 2024-02-07 10:34:06 -05:00
missing-file-error.md [2.x] fix: Report a missing input file clearly instead of an opaque SerializationException (#9271) 2026-05-30 19:29:41 -04:00
output-flush-coalescing.md [2.x] fix: Keep the output-flush timer alive across forceFlush (#9414) 2026-07-10 14:15:32 -04:00
parallel-dependency-resolution.md [2.x] fix: Parallelize dependency resolution when no progress bar is rendered (#9270) 2026-05-28 15:31:38 -04:00
parallel-resolution-supershell.md [2.x] feat: Resolve dependencies in parallel under the super shell (#9295) 2026-06-11 15:17:03 -04:00
patterns-maven-compatible-default.md [2.x] fix: Substitute [organisation] literally by defaulting Patterns.isMavenCompatible to false (#9344) 2026-06-15 23:54:28 -04:00
remote-project-update.md [2.x] fix: addressing review comments 2026-03-13 09:34:32 +03:00