Skip to content

Remove JUL handlers Maven installed when closing the embedded executor - #67

Closed
slachiewicz wants to merge 1 commit into
mainfrom
agent/fix-slf4j-bridge-leak
Closed

slachiewicz wants to merge 1 commit into
mainfrom
agent/fix-slf4j-bridge-leak

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Maven 4 installs an SLF4JBridgeHandler on the JVM-global JUL root logger; closing the embedded executor closes the realm that handler was loaded from, so the next JUL record in the test JVM (JUnit's TempDir message) failed with NoClassDefFoundError for org.slf4j.spi.LocationAwareLogger. The executor now removes the handlers loaded by its own realms before closing them, which also unblocks #60 and #63.

Verified: new EmbeddedMavenExecutorLoggingTest fails on main for Maven 4 (leaked SLF4JBridgeHandler) and passes with the fix; I could not reproduce the Windows JDK 26 cell locally.

Maven 4 puts an SLF4JBridgeHandler on the JVM-global JUL root logger. Closing the executor closes its class realm, so the next JUL record logged in the JVM (JUnit's TempDir message) failed with NoClassDefFoundError: org/slf4j/spi/LocationAwareLogger.
@slachiewicz slachiewicz added the bug Something isn't working label Oct 5, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review October 5, 2026 20:33
@slachiewicz slachiewicz added the wontfix This will not be worked on label Oct 7, 2026
@slachiewicz slachiewicz closed this Oct 7, 2026
@slachiewicz
slachiewicz deleted the agent/fix-slf4j-bridge-leak branch October 7, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant