[jira] [Commented] (CXF-7940) FileUtils.delete dramatically slowdown WildFly server shutdown

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (CXF-7940) FileUtils.delete dramatically slowdown WildFly server shutdown

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/CXF-7940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740514#comment-16740514 ]

Daniel Kulp commented on CXF-7940:
----------------------------------

Just a note:  with the removal of this, if there are temp files that are locked due to streams not being closed properly, they may remain after shutdown.   The purpose of that line was to hopefully get the file streams and such garbage collected and finalized so that the files can be removed.   With this change, if the delete fails, it will likely just keep the files around.  (and this is really just Windows issue as all the unix's can delete open files)

> FileUtils.delete dramatically slowdown WildFly server shutdown
> --------------------------------------------------------------
>
>                 Key: CXF-7940
>                 URL: https://issues.apache.org/jira/browse/CXF-7940
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.0.0-milestone1, 3.3.0
>         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
>            Reporter: Viacheslav
>            Assignee: Colm O hEigeartaigh
>            Priority: Minor
>             Fix For: 3.3.0
>
>
> *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|https://github.com/jbossws/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:
> {code:java}
> public static void delete(File f, boolean inShutdown) {
>         if (!f.delete()) {
>             if (isWindows()) {
>                 System.gc();
>             }
> {code}
> 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|https://github.com/apache/cxf/commit/88a9451b92180609b7bb93d0314bc8384f0c24a4#diff-b620deea897fb467b6f42abd1c32b7f2R138].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)