Bug 1375041
Summary: | [GSS](6.4.z) In OpenJDK 1.6 environment, EAP 6.4.x makes the vfs folder increased after restarting. | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | xuzhan | |
Component: | jbossas | Assignee: | Peter Palaga <ppalaga> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Peter Mackay <pmackay> | |
Severity: | high | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.4.0 | CC: | bmaxwell, fnasser, jason.greene, jtruhlar, msochure, pmackay, ppalaga, ppenicka | |
Target Milestone: | CR1 | |||
Target Release: | EAP 6.4.12 | |||
Hardware: | All | |||
OS: | All | |||
Whiteboard: | UpstreamNotAffected eap6412-proposed | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1397055 (view as bug list) | Environment: | ||
Last Closed: | 2017-01-17 13:14:43 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1375585, 1397055 |
Description
xuzhan
2016-09-12 03:48:05 UTC
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. |