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

IssueIndexListener indexing stale data

    XMLWordPrintable

Details

    Description

      JIRA appears to automatically configure and use an issue listener that handles updating the issue data in the lucene index after most issue events (IssueIndexListener). This issue listener seems to play by the same rules as the rest of the JIRA listeners, in that it is executed in a non-deterministic order with whatever other listeners have been added. If the ordering of this system issue listener falls AFTER the execution of a listener that updates the issue in response to an event, the correct data gets overwritten in the index.

      Note the following scenario I have observed with one of our listeners:

      1. User comments on an issue
      2. Issue comment event is fired
      3. Our custom listener is called and updates the issue (new assignee) which in turn triggers the proper events (since we are doing the update via the Jira IssueService).
        1. A new round of events is fired due to this update
        2. This triggers a reindex through JIRA's IssueIndexListener that appears to run successfully
      4. JIRA's IssueIndexListener kicks in again, but now with the original IssueEvent – the one that has the assignee value prior to our update
      5. Index is updated with the OLD assignee value

      The failure to ensure the built in IssueIndexListener runs before user specified listeners basically results in corruption of the index causing invalid data on user dashboards and search results. What makes it even more fun is that everything can be working just fine and the addition of a new listener could cause a reordering that breaks a configuration that was working previously.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              5774d8f4f1c6 Ryan Rich
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: