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

FileUtils.delete dramatically slowdown WildFly server shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.0.0-milestone1, 3.3.0
    • 3.3.0
    • Core
    • None
    • OS: Windows
      AppServer: WildFly 10.0.0.1.Final
      CXF: cxf-core-3.1.6
      jbossws-cxf: jbossws-cxf-server-5.1.5.Final

    • 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

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

            Dates

              Created:
              Updated:
              Resolved: