Interactive Java harness lab / Synthetic model

Timeout ownership: inspect work after the caller leaves

Change queue delay, work duration and deadline. Compare a timed-out wait with cancellation, including a worker that ignores interruption.

By Sandeep Belgavi · Published 2026-10-30

Evidence label: deterministic synthetic teaching model. This browser page executes a small JavaScript model of the stated policy. It does not run Java, access a JVM, create actual worker threads or contact a tool. Use it to understand the boundary and compare assumptions before running the separate Java example.

Predict the boundary before running the model

Predict whether a worker with duration twenty and deadline five can still create its final synthetic effect. Compare wait-only, cooperative cancellation and ignored interruption.

Write a prediction for the terminal outcome, then use Run model. The summary reports the calculated end-state for the current inputs. The trace begins at its first event so you can inspect how that outcome is reached. Next event advances one row; Show complete trace exposes every row. Restart trace changes only the viewing position, not the selected inputs.

Run and inspect the synthetic experiment

Expected outcomes and useful counterexamples

Wait-only mode leaves fifteen ticks of work after deadline five. Cooperative cancellation finishes its modeled cleanup two ticks after the deadline and avoids the final synthetic effect. Ignoring interruption allows late completion.

Change one input, rerun and compare the exact values in the table. A boundary that still holds under the changed inputs is more informative than an attractive animation. Trace rows and text labels carry the result; the visual colors are supplementary. The model recalculates only after Run model, so an edited input does not silently replace the trace you are inspecting.

What this lab cannot establish

Cancellation is modeled at explicit boundaries. There is no real interrupt, network socket, operating-system process or rollback. The final effect is assumed to happen only at worker completion; an actual remote effect can happen before cancellation is observed.

The controls have intentionally small finite ranges. They are not operational recommendations. No output here demonstrates production capacity, a recommended heap size, successful cancellation of a remote effect or a GC performance improvement. Use the downloadable Java fixture and then a representative integration test to investigate those separate questions. Keep the runtime version and the measurement method with any real results.

Continue with the Java implementation

Stop Java Harness Timeouts From Leaving Tool Work Running contains the original Java fixture, the failure analysis and its primary references. Continue with Keep Bounded Java Executor Queues From Hiding Harness Overload to examine the next ownership boundary. The examples have synthetic non-personal inputs and do not require an account, API key or external service.

All six guides and labs · Lab catalog.

Views are my own and do not represent any employer, past or present.