Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-2979

Timeout leaves LRA active and able to complete

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.7.1.Final
    • Fix Version/s: 5.9.0.Final
    • Component/s: LRA
    • Labels:
      None
    • Steps to Reproduce:
      Hide
      # Shell 1: reply OK first time, then show the other messages
      while true ; do nc -l -p 8889 -c 'echo -e "HTTP/1.1 200 OK\n\n $(date)"'; echo 'Replied OK to coordinator, now listening...'; nc -kl 8889; done
      
      # Shell 2: create LRA with timelimit on join
      COORDINATOR_URL=http://localhost:8080/lra-coordinator
      echo "Creating new LRA"
      LRA_URL=$(curl -X POST $COORDINATOR_URL/start | sed "s/\"//g")
      echo "Joining LRA"
      curl -X PUT $LRA_URL?TimeLimit=8000 -d http://localhost:8889
      
      # ... Wait 8 seconds for shell 1 to reply OK to timeout-compensate
      # On shell 2:
      curl $COORDINATOR_URL
      
      # This will show that the LRA is still active and all flags are false (compensated=false, compensating=false, ..)
      # We can even close it
      curl -X PUT $LRA_URL/close
      
      # On shell 1 you'll see a call to /complete (note that participant has already compensated)
      
      Show
      # Shell 1: reply OK first time, then show the other messages while true ; do nc -l -p 8889 -c 'echo -e "HTTP/1.1 200 OK\n\n $(date)" ' ; echo 'Replied OK to coordinator, now listening...' ; nc -kl 8889; done # Shell 2: create LRA with timelimit on join COORDINATOR_URL=http: //localhost:8080/lra-coordinator echo "Creating new LRA" LRA_URL=$(curl -X POST $COORDINATOR_URL/start | sed "s/\" //g") echo "Joining LRA" curl -X PUT $LRA_URL?TimeLimit=8000 -d http: //localhost:8889 # ... Wait 8 seconds for shell 1 to reply OK to timeout-compensate # On shell 2: curl $COORDINATOR_URL # This will show that the LRA is still active and all flags are false (compensated= false , compensating= false , ..) # We can even close it curl -X PUT $LRA_URL/close # On shell 1 you'll see a call to /complete (note that participant has already compensated)

      Description

      If a participant declares a timeout, the coordinator calls its "/compensate" endpoint when the timeout expires. But the LRA remains active and it may be possibly closed, leading to a second call to "/complete" on the participant, even if he has already compensated.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mmusgrov Michael Musgrove
                Reporter:
                nibbio84 Nicola Ferraro
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: