Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7940

FileUtils.delete dramatically slowdown WildFly server shutdown

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-milestone1, 3.3.0
    • Fix Version/s: 3.3.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      OS: Windows
      AppServer: WildFly 10.0.0.1.Final
      CXF: cxf-core-3.1.6
      jbossws-cxf: jbossws-cxf-server-5.1.5.Final

    • Estimated Complexity:
      Unknown

      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.

        Attachments

          Activity

            People

            • Assignee:
              coheigea Colm O hEigeartaigh
              Reporter:
              veselroger Viacheslav
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: