Skip to content

Commit a624d3d

Browse files
dfa1claude
andcommitted
fix(cli): use queue.add over offer in IoWorker
offer silently drops tasks on bounded queues; add throws IllegalStateException making task loss visible. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2dae3ca commit a624d3d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

cli/src/main/java/io/github/dfa1/vortex/cli/tui/IoWorker.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public void submit(Runnable task) {
3939
return;
4040
}
4141
pending.incrementAndGet();
42-
queue.offer(() -> {
42+
// Unbounded {@link LinkedBlockingQueue} never rejects on capacity; {@code add} is the
43+
// right idiom (throws {@code IllegalStateException} on the impossible case) so we don't
44+
// silently drop tasks if anyone ever swaps in a bounded queue.
45+
queue.add(() -> {
4346
try {
4447
task.run();
4548
} finally {

0 commit comments

Comments
 (0)