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

Timeout leaves LRA active and able to complete

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.9.0.Final
    • 5.7.1.Final
    • LRA
    • None
    • 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)

      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.

              rhn-engineering-mmusgrov Michael Musgrove
              nicolaferraro Nicola Ferraro (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: