Skip to content

Shut down executor threads after timeout to prevent JaCoCo EOFException#1303

Open
mrigger wants to merge 1 commit intomainfrom
fix-jacoco-eof-on-timeout
Open

Shut down executor threads after timeout to prevent JaCoCo EOFException#1303
mrigger wants to merge 1 commit intomainfrom
fix-jacoco-eof-on-timeout

Conversation

@mrigger
Copy link
Contributor

@mrigger mrigger commented Mar 26, 2026

When executeMain times out, awaitTermination returns but worker threads remain running (non-daemon). For remote DBs like Materialize, threads blocked on network I/O prevent the JVM from exiting cleanly, causing surefire to forcibly kill the process before JaCoCo can flush jacoco.exec, resulting in an EOFException during report generation.

Calling shutdownNow() after the timeout interrupts threads (PostgreSQL JDBC socket reads respond to Thread.interrupt()), allowing them to exit and JaCoCo to write complete coverage data.

When executeMain times out, awaitTermination returns but worker threads
remain running (non-daemon). For remote DBs like Materialize, threads
blocked on network I/O prevent the JVM from exiting cleanly, causing
surefire to forcibly kill the process before JaCoCo can flush jacoco.exec,
resulting in an EOFException during report generation.

Calling shutdownNow() after the timeout interrupts threads (PostgreSQL
JDBC socket reads respond to Thread.interrupt()), allowing them to exit
and JaCoCo to write complete coverage data.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant