Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-69840

Operation on worklogs may results in inconsistent timespent when done in parallel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 8.3.0, 7.13.6, 8.3.2
    • None

    Description

      Summary

      When a specific JIRA issue worklog is being filled concurrently from different sources at the same time, some worklog entries are missed; resulting in inaccurate timespent value. In the case where the user also uses Tempo timetracking, there is a difference between JIRA's timespent and Tempo's.

      Steps to Reproduce

      1. Create an integrated system that operates in Jira
      2. Do several work logs operations such as adding work logs to the same issue
      3. Run the following queries to verify timespent and timeworked data
        Total count of worklog added in an issue
        select count(*) from worklog where issueid = <issueID>;
        
        Sum of worklog added in an issue
        select sum(timeworked) from worklog where issueid = <issueID>;
        
        Sum of timespent in an issue
        select timespent from jiraissue where id = <issueID>;
        

        Replace <issueID> with the issue ID

      Expected Results

      The time spent of the issue (shown as logged in time tracking panel) equals the sum of all existing work logs.

      Actual Results

      Because the time spent is stored separately and there isn't a control of parallel changes in that, it may not be equal to the sum of work logged.

      Notes

      We carried out 2 tests as proof of concept:

      1. A script run twice sequentially (waiting for first run to finish to start another one) where we add 60 seconds of work logs 100 times
      2. Same as above, but both are run at the same time in parallel

      In both cases we expected 12000 seconds of time spent on that issue and that is what we got in the first test, but we got 9840 on the second as in some cases, the creation of a work log interfered with another running at the same time.

      Workaround

      No perfect workaround, but avoiding running 2 work logs operations in the same issue prevents this problem.

      Attachments

        1. data
          0.1 kB
          Chung Park Chan
        2. loop.sh
          0.2 kB
          Chung Park Chan

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cchan Chung Park Chan
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: