Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid file leak in RemoteExtensionLoader #502

Merged
merged 2 commits into from Nov 9, 2023

Conversation

WolfgangHG
Copy link
Contributor

@WolfgangHG WolfgangHG commented Oct 6, 2023

This problem was found as part of arquillian/arquillian-extension-warp#131 - full details see there.

When deploying a test using arquillian-extension-warp to GlassFish 4.1 or newer running on a Windows machine (no problem on linux), all Jars that are inside "WEB-INF\lib" of the deployed app are locked and the app has a long delay until GlassFish performs the "undeploy" operation.
Using File Leak Detector, I found that org.jboss.arquillian.container.test.impl.RemoteExtensionLoader is one of the culprits for this leak: URL.openStream creates a java.net.JarConnection that caches opened files by default.
As those files are accessed only once in Arquillian, there is no performance reason to cache them.

This pull request switches off caching and closed the file afterwards.

Unfortunately, this does not help against the undeploy problems, because GlassFish seems to have a bug, and another piece of code also does not close the file properly. Hopefully, this was fixed with GlassFish 6, but I cannot test it, as "arquillian-extension-warp" would have to be updated to JakartaEE first.

WildFly is not affected by this problem because of the underlying VFS implementation. But GlassFish accesses the files directly.

@starksm64 starksm64 merged commit 4846460 into arquillian:master Nov 9, 2023
2 checks passed
@WolfgangHG WolfgangHG deleted the fileleak branch November 12, 2023 10:12
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.

None yet

2 participants