Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21489

Deadlock retries have been accidentally blocked

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.27
    • Fix Version/s: 5.1
    • Component/s: Core CiviCRM
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      The Database class has handling in it for deadlocks but some time ago, likely around 4.2, we introduced changes that cause it to be bypassed. When 

      $result = $DB->query($string) 

      is called & there is a deadlock, it used to return a PEAR_Error object. If the $result was a PEAR_Error then 3 retries were attempted.

      However, we made changes to exception handling a while back (around 4.2 I think) that meant that an exception was thrown, by-passing the retry code.

      Since this is an unmaintained (& previously hacked) package I think we just patch our version & I propose that we also add a Constant to allow sites to specify the number of retries. This is pretty low-level developer stuff so I don't propose a setting, although some helper text can go in civicrm.settings.php on new installs.

       

      I'm also somewhat inclined to allow some control over the retry period - although probably a second is fine to be a compromise between totally hammering & lingering. To get a longer period retries could be fairly high since a second apart is not crazy.

       

      Dave Jenkins Seamus Lee Jitendra Purohit Monish Deb John Kingsnorth - you may have an interest in this.

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: