DVCS Repository synchronisation is stuck because of SLEEPING messages on queue

XMLWordPrintable

    • 8.13
    • 30
    • Severity 3 - Minor
    • 5

      Issue Summary

      This is reproducible on Data Center: yes

      Repository synchronization cannot end because on queue exists messages in state SLEEPING.

      Steps to Reproduce

      Repository that you are going to sync should have messages on queue in status SLEEPING.
      Below are sql queries which you can use to detect such repositories.

      1. Open DVCS admin panel
      1. Find proper repository
      1. Trigger soft sync

      Expected Results

      Repository synchronization will end after some time. 

      Actual Results

      Synchronization for this repository will stuck after a while 

      Workaround

      The same as in: https://jira.atlassian.com/browse/JSWSERVER-21024

       

      How to detect it?

      You can run below query:

      Postgresql
      findAllRepositories

      SELECT messageTag."TAG", count(messageTag."TAG") FROM "AO_E8B6CC_MESSAGE" messageMapping
      JOIN "AO_E8B6CC_MESSAGE_TAG" messageTag ON messageMapping."ID" = messageTag."MESSAGE_ID"
      JOIN "AO_E8B6CC_MESSAGE_QUEUE_ITEM" messageQueueItem ON messageMapping."ID" = messageQueueItem."MESSAGE_ID"
      WHERE messageTag."TAG" in (select concat('synchronization-repository-', repo."ID") from "AO_E8B6CC_REPOSITORY_MAPPING" repo where repo."LINKED" is true)
      AND messageQueueItem."STATE" = 'SLEEPING'
      group by messageTag."TAG" order by count(messageTag."TAG"); 

      As result will be list of tags. Number at the end of tag it is a repository id. So query shows ids of repositories which are in faulty state.

      checkParticularRepository (Remember to change <repoId>)

      SELECT count(messagemapping) as "Number of faulty messages" FROM "AO_E8B6CC_MESSAGE" messageMapping
      JOIN "AO_E8B6CC_MESSAGE_TAG" messageTag ON messageMapping."ID" = messageTag."MESSAGE_ID"
      JOIN "AO_E8B6CC_MESSAGE_QUEUE_ITEM" messageQueueItem ON messageMapping."ID" = messageQueueItem."MESSAGE_ID"
      WHERE messageTag."TAG" = concat('synchronization-repository-', (select repo."ID" from "AO_E8B6CC_REPOSITORY_MAPPING" repo where repo."LINKED" is true and repo."ID" = <repoID>))
      AND messageQueueItem."STATE" = 'SLEEPING'; 

      As result will be number of messages linked to repository which are in undesired state SLEEPING.

      Known root cause of repository faulty state and its messages:

      https://jira.atlassian.com/browse/JSWSERVER-21377

            Assignee:
            Benjamin Woodforde
            Reporter:
            Artur Luszcz (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: