Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3098

Work around deadlock when creating invoices

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      A deadlock can sometimes be encountered when creating invoices for large data sets, particularly the combination of the cron running to create invoices from services while the system adds an invoice elsewhere.

      1. Replicate the deadlock consistently to fix
      2. Attempt to retry the transaction that deadlocked
      3. If necessary, wait before running
        • The script can sleep for a period of time (50-100ms) so there is a small window where a new invoice could be created if they are created too frequently that there is no time window for another process to create an invoice

        Activity

        tyson Tyson Phillips (Inactive) created issue -
        tyson Tyson Phillips (Inactive) made changes -
        Field Original Value New Value
        Rank Ranked higher
        tyson Tyson Phillips (Inactive) made changes -
        Story Points 5
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.6.0 Sprint 6 [ 81 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked higher
        Automated transition triggered when Tyson Phillips (Inactive) created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        Automated transition triggered when Tyson Phillips (Inactive) created pull request #647 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        tyson Tyson Phillips (Inactive) made changes -
        Security Private [ 10000 ]
        tyson Tyson Phillips (Inactive) made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 3 hours, 30 minutes [ 12600 ]
        Worklog Id 12130 [ 12130 ]
        tyson Tyson Phillips (Inactive) made changes -
        Time Spent 3 hours, 30 minutes [ 12600 ] 3 hours, 38 minutes [ 13080 ]
        Worklog Id 12133 [ 12133 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 3 hours, 38 minutes [ 13080 ] 3 hours, 53 minutes [ 13980 ]
        Worklog Id 12139 [ 12139 ]
        Automated transition triggered when Tyson Phillips (Inactive) merged pull request #647 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              28/May/19

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 3 hours, 53 minutes
              3h 53m

                Agile