Description of problem: When restart EAP 6.4.x under JDK 1.6 environment, a new folder named "deployment-to-be-deleted-xxxx" will be generated under ${EAP_HOME}/standalone/tmp/vfs, stop EAP will not delete them. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. install OpenJDK 1.6 then set JAVA_HOME correctly. 2. unzip "jboss-eap-6.4.0.zip" and start it as standalone mode(can patch it). 3. deploy .ear package to it, then restart EAP several times. 4. observe ${EAP_HOME}/standalone/tmp/vfs, new "deployment-to-be-deleted-xxxx" folder will be created. 5. stop EAP by "Ctrl+C", however, those folders will not be deleted. Actual results: A new "deployment-to-be-deleted-xxxx" will be created under %{EAP_HOME}/standalone/tmp/vfs Expected results: Only "temp" and "deployment" folders should be there Additional info: In JDK 1.7.x, such issue was gone, please let us know if anything wrong.
I was able to reproduce this on Oracle Java 1.6.0_45. I could trace the issue down to ScheduledThreadPoolExecutor not executing the DeleteTask submitted in [1]. Note that the executor is created using new ScheduledThreadPoolExecutor(0, threadFactory) in org.jboss.as.server.deployment.module.TempFileProviderService. Having seen several reports that ScheduledThreadPoolExecutor with corePoolSize=0 does not execute the tasks I tried ScheduledThreadPoolExecutor(1, threadFactory) and the issue stopped happening. I'll have to investigate further if this is a good solution also for newer Java versions. [1] https://github.com/jbossas/jboss-vfs/blob/54cabe6f9001fbfe45d8a84b96f96cf215366e30/src/main/java/org/jboss/vfs/TempFileProvider.java#L97
ScheduledThreadPoolExecutor with corePoolSize 0 does not schedule the tasks not only on early versions of Java 7 (as stated in https://bugs.openjdk.java.net/browse/JDK-7091003 ) but also on Java 1.6 which we see happening here. There is this case in JDK-7091003: final ScheduledExecutorService ex = Executors.newScheduledThreadPool(0); ex.schedule(new Runnable() { @Override public void run() { System.out.println("hello"); } }, 1, TimeUnit.SECONDS); ex.shutdown(); ex.awaitTermination(5, TimeUnit.SECONDS); JDK-7091003 states that the test passes on JDK 1.6.0_26-b03 correctly outputting "hello". While I can confirm the output, the following needs to be added: If we change the test as follows: final ScheduledExecutorService ex = Executors.newScheduledThreadPool(0); ex.schedule(new Runnable() { @Override public void run() { System.out.println("hello"); } }, 1, TimeUnit.SECONDS); System.out.println("scheduled"); Thread.sleep(5000); System.out.println("slept"); ex.shutdown(); ex.awaitTermination(5, TimeUnit.SECONDS); then the output on Java 6 (e.g. 1.6.0_26 and 1.6.0_45) is scheduled slept hello This is clearly not what we expect. We expect "hello" before "slept" as is indeed the case on newest versions of Java 7 and Java 8. The modified test case shows, that on Java 6, the task execution is actually triggered by ScheduledExecutorService.shutdown(). Using ScheduledThreadPoolExecutor with corePoolSize 1 still seems to be a valid fix on Oracle/Sun Java 6.
Note that all JDKs referred to in Comment#2 are from Oracle/Sun. I have run the modified test on several more JDKs. Here is the summary: Need a fix: * Oracle/Sun 1.6.0_26, 1.6.0_45: the order is scheduled, slept, hello * OpenJDK 1.6.0_24: the "hello" output is not coming at all. * IBM JDK 6.0-16.30: the order is scheduled, slept, hello OK: * Oracle 7, 8: the order is scheduled, hello, slept * OpenJDK 1.8.0_102: the order is scheduled, hello, slept * IBM JDK 7.1-2.10: the order is scheduled, hello, slept * IBM JDK 8.0-0.0: the order is scheduled, hello, slept Untested: * OpenJDK 1.7 unable to install
Setting UpstreamNotAffected because newer EAP versions are not supported on Java 6.
The issue is fixed in EAP 6.4.12.CP.CR1 for both Oracle and OpenJDK. However, I am still able to reproduce it when using IBM 1.6 JDK.
Since the IBM Java issue is tracked in a separate BZ, setting this to verified.
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.