Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1335

Do not use temporary file when downloading a small document

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1.1
    • Fix Version/s: NoFixVersionApplicable
    • Component/s: Framework

      Description

      Currently we are storing downloaded contents into a temporary file of type .NAME.nxpart.

      A nice improvement that may help to have better stability in tests and the synchronization in general would be to use in-memory buffers for small files. Here, small would be something like 10 Mo to start. That value can be modified from contants.MAX_SIZE.

      This is a log extraction from a simple download of a PDF file:

      139878240855808 remote_client  T Downloading file from 'http://127.0.0.1:8080/nuxeo/nxfile/default/cbea21eb-e3c1-4334-9659-19a81602ed1d/blobholder:0/testFile.pdf' to '~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart' with digest='d3ddaa0f7725d11ff35567b8d82fc5ff'
      139878293567232 inotify_buffer D in-event <InotifyEvent: src_path=b'~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart', wd=3, mask=IN_CREATE, cookie=0, name=.testFile.pdf139878240855808.nxpart>
      139878293567232 inotify_buffer D in-event <InotifyEvent: src_path=b'~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart', wd=3, mask=IN_MODIFY, cookie=0, name=.testFile.pdf139878240855808.nxpart>
      139878240855808 local_client   T Setting xattr 'ndrive' with value b'defaultFileSystemItemFactory#default#cbea21eb-e3c1-4334-9659-19a81602ed1d' on '~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart'
      139878293567232 inotify_buffer D in-event <InotifyEvent: src_path=b'~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart', wd=3, mask=IN_ATTRIB, cookie=0, name=.testFile.pdf139878240855808.nxpart>
      139878293567232 inotify_buffer D in-event <InotifyEvent: src_path=b'~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart', wd=3, mask=IN_MOVED_FROM, cookie=44325, name=.testFile.pdf139878240855808.nxpart>
      139878655383296 local_watcher  T Queueing watchdog: <FileMovedEvent: src_path='~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/.testFile.pdf139878240855808.nxpart', dest_path='~/projects/tmp/tmpebl3yttadrive-1/Nuxeo Drive/Nuxeo Drive Test Workspace/Test folder/testFile.pdf'>
      

      On Windows, this is even worse.

      We could save a lot of false FS events and disk I/O. The synchronization would benefit a lot.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mschoentgen Mickaël Schoentgen
                Reporter:
                mschoentgen Mickaël Schoentgen
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m