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

Resource leak when installing features through Gradle on Windows #10178

Closed
ericglau opened this issue Dec 16, 2019 · 0 comments · Fixed by #10200
Closed

Resource leak when installing features through Gradle on Windows #10178

ericglau opened this issue Dec 16, 2019 · 0 comments · Fixed by #10200
Labels
in:Install release bug This bug is present in a released version of Open Liberty release:20001

Comments

@ericglau
Copy link
Contributor

ericglau commented Dec 16, 2019

Describe the bug
After installing features through Gradle, the Liberty directory cannot be deleted. It looks like this is caused by InstallMap.java using a URLClassLoader with the Liberty jars, and the URLClassLoader is never closed. See this part of the code

ClassLoader loader = new URLClassLoader(jars, getClass().getClassLoader());

Steps to Reproduce

  1. Clone the gradle branch of https://github.com/OpenLiberty/demo-devmode
  2. Run gradle installFeature
  3. Run gradle clean

The following error occurs:

Execution failed for task ':clean'.
> java.io.IOException: Unable to delete directory 'C:\Users\Eric\git\demo-devmode\build'
    Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
    - C:\Users\Eric\git\demo-devmode\build\wlp\dev\api\spec\com.ibm.websphere.javaee.jsonp.1.0_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\dev\api\spec
    - C:\Users\Eric\git\demo-devmode\build\wlp\dev\api
    - C:\Users\Eric\git\demo-devmode\build\wlp\dev
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.config_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.crypto.passwordutil_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.install.map_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.install_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.kernel.boot_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.kernel.feature_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.kernel.service_1.3.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.logging_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.org.apache.aries.util_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.org.eclipse.equinox.metatype_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.org.glassfish.json.1.0_1.0.35.jar
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib\com.ibm.ws.product.utility_1.0.35.jar
    - and more ...
    New files were found. This might happen because a process is still writing to the target directory.
    - C:\Users\Eric\git\demo-devmode\build\wlp
    - C:\Users\Eric\git\demo-devmode\build\wlp\lib

Expected behavior
The Liberty directory should be able to be deleted.

Diagnostic information:

  • OpenLiberty Version: any (tried 19.0.0.6, 19.0.0.9, 19.0.0.12).
  • Java Version:
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

Additional context
The symptoms above happen only with Gradle on Windows.

@ericglau ericglau added bug This bug is not present in a released version of Open Liberty in:Install labels Dec 16, 2019
@ericglau ericglau added release bug This bug is present in a released version of Open Liberty and removed bug This bug is not present in a released version of Open Liberty labels Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Install release bug This bug is present in a released version of Open Liberty release:20001
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants