Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6236

Files.remove() causes a 5 seconds delay instead of 500ms as was intended

    XMLWordPrintableJSON

Details

    Description

      The method Files.remove(final java.io.File file) has a cycle for trying to delete a file.
      As Javadoc says, it was intended to re-try 50 times, with a delay of 100ms at each 10th attemp (implemented with 2 cycles, one inside another), but acctually it has a 100ms delay EACH time, because the sleep is inside the inner cycle. This produces a delay of 5 secs for each file, and if you have about 10 files it's a lot of time (about a minute).

      In windows using a page that has a model with a list of FileUpload, it tries to delete the files each time it recovers the Page from PageStore, and (I dont know why) can't delete any of the files, resulting in the mentioned delay. (in linux it works without problem)

      Besides the problem with windows locking the files, If the cycle works as intended (the sleep in the outer cycle), the problem will be smaller.

      Attachments

        Activity

          People

            pedrosans Pedro Santos
            eloyar eloy arce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified