ICEfaces
  1. ICEfaces
  2. ICE-3237

Constrain inputFile progress events

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All

      Description

      The progress events, that originate from the UploadServer, and are sent to the InputFile component, and then become invocations on the progressListener, and also become render calls if progressRender=true, are based on hard-coded 10% increments in file upload progress. Ideally this would be customised by ICE-3125. But, it would be nice for a sane default, in the absence of configurable progress intervals.

      Complicating matters, there's 5 ways for progress events to end up causing renders:

      1. progressListener uses RenderManager / OnDemandRenderer
      2. progressListener uses PersistentFacesState.render()
      3. progressListener uses PersistentFacesState.renderLater()
      4. progressRender uses PersistentFacesState.render() for Seam
      5. progressRender uses PersistentFacesState.renderLater()

      The RenderManager will happen on another thread, meaning that the renders won't delay the actual file uploading, and it will detect and remove redundantly queued render requests. This scenario doesn't really need constrained progress events. It's for the other scenarios.

      PersistentFacesState.renderLater() renders on another thread, but does not detect or remove redundantly queued render requests. There is no obvious API to access to enable that functionality. So, one has to constrain the render requests, so that for small files, where the 10% increments are milliseconds apart, there aren't 5 to 8 rendundant render requests queued up, making the page repeated render for a while after the upload has completed.

      PersistentFacesState.render() will do the render in the current thread, which will delay the file uploading, taking more total time, on a fast network. But, it solves certain thread local issues. Again, for small files, it's best not to render for ever 10% gain, since we could spend hundreds of milliseconds rendering for every 1 millisecond of file uploading.

        Activity

        Hide
        Mark Collette added a comment -

        There's now code that, for progress events, will only make the progress events happen, if they are 500ms after the previous one. Which means, for example, in your bean you may get 0%, 40%, and 100% in a given upload, instead of before where you would get every one of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%. Well, there was no guarantee for the initial ones anyways, because some of the file might come in the same chunk as the file name and meta-data.

        It might have been doable to limit it to 1 seconds intervals, but I felt there would be no debate on 1/2 second intervals being too long.

        TRUNK
        Subversion 16991
        icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java

        ICEfaces 1.7 branch
        Subversion 16992
        icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java

        Show
        Mark Collette added a comment - There's now code that, for progress events, will only make the progress events happen, if they are 500ms after the previous one. Which means, for example, in your bean you may get 0%, 40%, and 100% in a given upload, instead of before where you would get every one of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%. Well, there was no guarantee for the initial ones anyways, because some of the file might come in the same chunk as the file name and meta-data. It might have been doable to limit it to 1 seconds intervals, but I felt there would be no debate on 1/2 second intervals being too long. TRUNK Subversion 16991 icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java ICEfaces 1.7 branch Subversion 16992 icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: