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

Do not remove staled transfers at startup if the application crashed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.4.5
    • Component/s: Framework
    • Release Notes Summary:
      Smarter management for staled transfers
    • Release Notes Description:
      Hide

      The application has a notion of "staled transfers". A staled transfer has the ONGOING status, meaing it is currently being processed.

      Normally, this status cannot be if the application was correctly shut down. In that case, such transfers will be purged at startup. This likely means there was an error somewhere and the transfer will unlikely being able to resume. This was done initially to remove infinite transfers on proxy documents.

      On the other end, if the application hard-crashed at the previous run, such transfers should be adapted to being able to resume. Removing them would likely make some users angry.

      Show
      The application has a notion of "staled transfers". A staled transfer has the ONGOING status, meaing it is currently being processed. Normally, this status cannot be if the application was correctly shut down. In that case, such transfers will be purged at startup. This likely means there was an error somewhere and the transfer will unlikely being able to resume. This was done initially to remove infinite transfers on proxy documents. On the other end, if the application hard-crashed at the previous run, such transfers should be adapted to being able to resume. Removing them would likely make some users angry.
    • Epic Link:
    • Tags:
    • Sprint:
      nxDrive 11.2.1
    • Story Points:
      3

      Description

      Error

      I just hit that issue: I was uploading a 100 GB file to the intranet and the app crashed. When I restarted the app (4.4.4 alpha), the transfer was then removed by Engine.remove_staled_tansfers() because the transfer was still ongoing as the app did not have time to change its state before correctly quitting.

      Here is the only information available before the crash:

      (process:30472): GLib-ERROR **: 11:46:00.155: Creating pipes for GWakeup: Trop de fichiers ouverts
      30472 Trappe pour point d'arrêt et de trace
      

      Fix

      First, we need to have a way to know if the app has crashed.
      Then, at startup, if the app did not crash, then we can remove staled transfers.

      Knowing When the Application Crashed

      Idea 1: store a value in the database of the Manager, something like has_crashed:

      • At startup:
        • If the value is True, it will mean the app crashed.
        • If the value does not exist, or is set to False, it will mean the app did not crash.
      • When the startup is completely done, set the value to True.
      • At exit, the value is set to False.

      Idea 2: create a "crash" file in the NXDRIVE_HOME folder:

      • At startup:
        • If the file exists, it will mean the app crashed.
        • If the files does not exist, it will mean the app did not crash.
      • When the startup is completely done, create the file.
      • At exit, delete the file.

      For both ideas, on crash, the "at exit" step will not be done, so at the next start we will know that the app crashed.

      The second idea may be better as it does not rely on the database, which can be altered or part of the crash source.

      Implementation Details

      Using the idea 2, a new global option will be added: Options.has_crashed (boolean).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 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 day, 1 hour, 30 minutes
                  1d 1h 30m

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.