Details
Description
Brief introduction:
We use WildFly server.
As we know, WildFly based on JBoss Application Server.
WildFly have an integration with Apache CXF through "jbossws-cxf" project.
When WildFly server is stops we see repeated invokes of WSDLFilePublisher.java#unpublishWsdlFiles that invoke FileUtils#removeDir
Cause of problems:
When the method FileUtils#removeDir is invoked then we see the invoke of FileUtils#delete:
https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/helpers/FileUtils.java#L254.
We see some strange code:
public static void delete(File f, boolean inShutdown) { if (!f.delete()) { if (isWindows()) { System.gc(); }
This leads to dramatically slowdown of WildFly server shutdown on Windows systems.
For example, our WildFly server stops in 2781ms without this call AND stops in 119882ms with this call (~ 43 times slower).
Questions:
What is the reason of this code?
Is it bug? What are the disadvantages of removing this code?
Last changes of this code from Git Blame: commit.