Jetty
  1. Jetty
  2. JETTY-506

review code for "Can't reuse" warning of temporary directory.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 6.1.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      eclipse
    • Number of attachments :
      1

      Description

      The following warning was reported on IRC:

      342422 [Timer-0] WARN org.mortbay.log - Can't reuse C:\DOCUME~1\btiernay\LOCALS~1\Temp\Jetty_127_0_0_1_8080_Linkory.war___57jvfm, using C:\DOCUME~1\btiernay\LOCALS~1\Temp\Jetty_127_0_0_1_8080_Linkory.war___57jvfm_845

        Activity

        Hide
        Jan Bartel added a comment -

        dyu,

        Can you try doing some redeploys using the eclipse plugin on a windows box and see if you an reproduce this error?

        thanks
        Jan

        Show
        Jan Bartel added a comment - dyu, Can you try doing some redeploys using the eclipse plugin on a windows box and see if you an reproduce this error? thanks Jan
        Jan Bartel made changes -
        Field Original Value New Value
        Assignee David Yu [ dyu ]
        Hide
        David Yu added a comment -

        Couldn't replicate. The temp dir created by jetty gets re-used just fine.
        I've attached the undeploy-deploy logs.

        Show
        David Yu added a comment - Couldn't replicate. The temp dir created by jetty gets re-used just fine. I've attached the undeploy-deploy logs.
        David Yu made changes -
        Attachment eclipse-jetty-plugin-logs.txt [ 32662 ]
        Hide
        David Yu added a comment -

        The only instance that the tempDir cant be reused is when it is not deleted when the webapp stops.
        On WebAppContext.doStop, the snippet:

        if (_tmpDir!=null && Unable to render embedded object: File (_isExistingTmpDir && !isTempWorkDirectory()) //_tmpDir) not found.=null && !"work".equals(_tmpDir.getName()))

        { IO.delete(_tmpDir); _tmpDir=null; }

        I did some digging and found out that the Windows FileMappedBuffer "files-locked" issue is causing the problem.
        When the static files are accessed from the browser, those files cannot be edited nor deleted.
        So when the webapp restarts, it cannot delete the webapp unless the DefaultServlet frees up the resources... which
        would eventually need a server restart.(unless there is a way to redeploy just the DefaultServlet?)

        To reproduce, you'd have to deploy, acces the app(static files), then undeploy.
        Wasnt able to reproduce earlier because I did deploy and undeploy only without accessing.

        Cheers

        Show
        David Yu added a comment - The only instance that the tempDir cant be reused is when it is not deleted when the webapp stops. On WebAppContext.doStop, the snippet: if (_tmpDir!=null && Unable to render embedded object: File (_isExistingTmpDir && !isTempWorkDirectory()) //_tmpDir) not found. =null && !"work".equals(_tmpDir.getName())) { IO.delete(_tmpDir); _tmpDir=null; } I did some digging and found out that the Windows FileMappedBuffer "files-locked" issue is causing the problem. When the static files are accessed from the browser, those files cannot be edited nor deleted. So when the webapp restarts, it cannot delete the webapp unless the DefaultServlet frees up the resources... which would eventually need a server restart.(unless there is a way to redeploy just the DefaultServlet?) To reproduce, you'd have to deploy, acces the app(static files), then undeploy. Wasnt able to reproduce earlier because I did deploy and undeploy only without accessing. Cheers
        Hide
        David Yu added a comment -

        Correction, not deleting the webapp but deleting the temp directory of the webApp whose contents are extracted/exploded from the war.
        This would trigger on every undeploy-deploy of the webapp (whether via eclipse-plugin or not)
        Definitely a product of the Windows FileMappedBuffer "files-locked" issue.

        Jan/Greg... thoughts?

        Cheers

        Show
        David Yu added a comment - Correction, not deleting the webapp but deleting the temp directory of the webApp whose contents are extracted/exploded from the war. This would trigger on every undeploy-deploy of the webapp (whether via eclipse-plugin or not) Definitely a product of the Windows FileMappedBuffer "files-locked" issue. Jan/Greg... thoughts? Cheers
        David Yu made changes -
        Attachment eclipse-jetty-plugin-logs.txt [ 32665 ]
        David Yu made changes -
        Attachment eclipse-jetty-plugin-logs.txt [ 32662 ]
        Hide
        Greg Wilkins added a comment -

        I'll think about it for a bit

        Show
        Greg Wilkins added a comment - I'll think about it for a bit
        Greg Wilkins made changes -
        Assignee David Yu [ dyu ] Greg Wilkins [ gregw ]
        Greg Wilkins made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            Greg Wilkins
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: