LAB / 027
Java LLM practice (10): why is the reader still running after cancellation?
30 local HTTP connections separate conversation invalidation, reader exit and server work, comparing Future interruption with socket closure.
EXPERIMENT RESULT
01 / QUESTION
30 local HTTP connections separate conversation invalidation, reader exit and server work, comparing Future interruption with socket closure.
METHOD
Five loopback HTTP/SSE conditions × two cancellation policies × three repetitions: 30 real local connections.
RESULT
All 24 cancellations commit no history. Interrupt-only readers keep waiting; socket closure exits within 1ms in this local sample.
OBSERVATIONS
Dripping responses complete despite Future cancellation; the local server finishes eight bounded work steps after disconnect.
CONCLUSION
Verify conversation ownership, reader exit and remote cancellation acknowledgement separately; Future status cannot replace them.
LIMITATIONS
Classic Java8 Socket in fixed local conditions; deadline covers reading only. No SDK, TLS, online latency or billing-stop claim.
REPRODUCE
Pinned code and raw records are in the repository; the article provides run, audit and replay commands.
KEEP EXPLORING
Related content
- Engineering cases
Java LLM practice (10): why is the reader still running after cancellation?
30 local HTTP connections separate conversation invalidation, reader exit and server work, comparing Future interruption with socket closure.
- PROJECT / 002
Java LLM Practice
Reproducible Java conversation, retry and persistence boundaries, alongside attention, cache-cost and quantization-error experiments.
- Engineering cases
Java LLM practice (9): why can a cancelled answer overwrite a new conversation?
18 controlled thread schedules test request ownership for streaming previews, completion and errors, with cancellation and bounded deduplication.
- Engineering cases
Java LLM practice (8): should an interrupted stream enter conversation history?
22 loopback HTTP cases separate incremental preview from committing history, testing UTF-8, SSE framing, cancellation and abnormal endings.