Uploaded image for project: 'Z-Push'
  1. Z-Push
  2. ZP-1480

Retry loop when reading file state machine data from disk

    Details

    • Type: Improvement
    • Status: QA
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.5.0 beta1, 2.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Into specific enviroments with high traffic (and, i.e., file state on NFS storages) it could happen resource is momentarily not available and, when using file state machine, it happens file_get_contents function returns an empty file even if the file is not empty.
      As for ZP-1442 "Retry loop when writing file state machine data to disk", a parametric retry loop is added when reading file state machine data from disk to check if it could be empty.

      The loop executes up to 3 attempts with 100ms of sleep each when reading data to disk.

      There are 2 hidden configuration parameters to be added into z-push.conf.php for overwriting the default values:

      FILE_STATE_ATTEMPTS: number of attempts. If not defined default value is 3
      FILE_STATE_SLEEP: ms to sleep between attempts. If not defined default value is 100

      In ZP-1442 the 2 parameters were
      FILE_STATE_WRITE_ATTEMPTS and FILE_STATE_WRITE_SLEEP . These parameters are now shared between file and read retries so thay're going to be globally renamed

      Example of z-push.conf.php:

       

      /**********************************************************************************
      * Retry loop when writing/reading file state machine data to disk
      *
      * FILE_STATE_ATTEMPTS: number of attempts
      * FILE_STATE_SLEEP: ms to sleep between attempts
      */
      define('FILE_STATE_ATTEMPTS', 20);
      define('FILE_STATE_SLEEP', 200);

      With this patch, in our enviroment, we actually catch up to 40 errors per day avoiding client re-syncs.

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Sebastian Sebastian Kummer
                Reporter:
                michele.lunardi Michele Lunardi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: