Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22807

Livedata REST result have inconsistent results when called concurrently

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 16.4.7, 16.10.3, 17.0.0
    • 12.10
    • Live Data
    • None
    • Unknown
    • N/A
    • N/A
    • Awaiting Committer feedback

    Description

      It seem that sometime when we call the livedata rest API we don't have a consistent result when we do some call concurrently.

      We can see the consequence, for example on this issue: https://jira.xwiki.org/browse/BVERSION-106

      It's not an easy bug to reproduce manually, I was able to reproduce it but it happen randomly, not in all case.

      So to have a better way to reproduce this issue I made this following bash script:

      for ((i=0; i<10; i++)); do
          (
              versionClassNb=$(curl -s -u Admin:admin 'http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries?sourceParams.className=XWiki.XWikiUsers'  -H 'Accept: application/json, text/javascript, */*; q=0.01' | jq .count)
              sleep 0.2
              echo "Number of users: $versionClassNb"
          ) &
          proc1Nb=$!
      
          (
              pageStatusClassNb=$(curl -s -u Admin:admin 'http://localhost:8080/xwiki/rest/liveData/sources/liveTable/entries?sourceParams.className=XWiki.XWikiRights' -H 'Accept: application/json, text/javascript, */*; q=0.01' | jq .count)
              sleep 0.3
              echo "Number of rights $pageStatusClassNb"
          ) &
          proc2Nb=$!
      
          wait $proc1Nb
          wait $proc2Nb
      
      done
      

      When I run this script on a clean xwiki instance on 16.10.1 I've this result:

      Number of users: 1
      Number of rights 1
      Number of users: 3
      Number of rights 3
      Number of users: 1
      Number of rights 1
      Number of users: 1
      Number of rights 1
      Number of users: 3
      Number of rights 3
      Number of users: 3
      Number of rights 3
      Number of users: 3
      Number of rights 3
      Number of users: 1
      Number of rights 1
      Number of users: 1
      Number of rights 3
      Number of users: 1
      Number of rights 1
      

      Normally we expect that we have always:

      Number of users: 1
      Number of rights 3
      

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            josue Josué Tille
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: