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

Participants should not be told to compensate after completion

    XMLWordPrintable

    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: listen for connections (does not reply) and print output
      nc -kl 8888
      
      # Shell 2: create a saga and close it
      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 -d http://localhost:8888
      echo "Close LRA"
      curl -X PUT $LRA_URL/close
      
      
      # Output of shell 1
      PUT /complete HTTP/1.1
      Accept-Encoding: gzip, deflate
      Content-Type: application/json
      Long-Running-Action: http://localhost:8080/lra-coordinator/0_ffff0a2140b4_-14db9cf6_5a3bdf77_241
      Long-Running-Action-Recovery: http://localhost:8080/lra-recovery-coordinator/http%3A%2F%2Flocalhost%3A8080%2Flra-coordinator%2F0_ffff0a2140b4_-14db9cf6_5a3bdf77_241/0_ffff0a2140b4_-14db9cf6_5a3bdf77_24e
      Content-Length: 0
      Host: localhost:8888
      Connection: Keep-Alive
      
      ###### After some seconds, when periodic recovery starts ######
      
      PUT /compensate HTTP/1.1
      Accept-Encoding: gzip, deflate
      Content-Type: application/json
      Long-Running-Action: http://localhost:8080/lra-coordinator/0_ffff0a2140b4_-14db9cf6_5a3bdf77_241
      Long-Running-Action-Recovery: http://localhost:8080/lra-recovery-coordinator/http%3A%2F%2Flocalhost%3A8080%2Flra-coordinator%2F0_ffff0a2140b4_-14db9cf6_5a3bdf77_241/0_ffff0a2140b4_-14db9cf6_5a3bdf77_24e
      Content-Length: 0
      Host: localhost:8888
      Connection: Keep-Alive
      
      Show
      # # Shell 1: listen for connections (does not reply) and print output nc -kl 8888 # Shell 2: create a saga and close it 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 -d http: //localhost:8888 echo "Close LRA" curl -X PUT $LRA_URL/close # Output of shell 1 PUT /complete HTTP/1.1 Accept-Encoding: gzip, deflate Content-Type: application/json Long -Running-Action: http: //localhost:8080/lra-coordinator/0_ffff0a2140b4_-14db9cf6_5a3bdf77_241 Long -Running-Action-Recovery: http: //localhost:8080/lra-recovery-coordinator/http%3A%2F%2Flocalhost%3A8080%2Flra-coordinator%2F0_ffff0a2140b4_-14db9cf6_5a3bdf77_241/0_ffff0a2140b4_-14db9cf6_5a3bdf77_24e Content-Length: 0 Host: localhost:8888 Connection: Keep-Alive ###### After some seconds, when periodic recovery starts ###### PUT /compensate HTTP/1.1 Accept-Encoding: gzip, deflate Content-Type: application/json Long -Running-Action: http: //localhost:8080/lra-coordinator/0_ffff0a2140b4_-14db9cf6_5a3bdf77_241 Long -Running-Action-Recovery: http: //localhost:8080/lra-recovery-coordinator/http%3A%2F%2Flocalhost%3A8080%2Flra-coordinator%2F0_ffff0a2140b4_-14db9cf6_5a3bdf77_241/0_ffff0a2140b4_-14db9cf6_5a3bdf77_24e Content-Length: 0 Host: localhost:8888 Connection: Keep-Alive

      Description

      When a LRA is closed the coordinator behaves incorrectly if a participant is slow to respond.

      While the call to "/complete" is still ongoing, the coordinator (recovery module) may issue a second call to "/compensate", making it impossible for the participant to determine when a LRA is really closed.

      The LRA coordinator must choose a single outcome for the LRA and be consistent with that (retrying until all participants are in status complete/failedtocomplete in this case).

      A second minor problem is that the call to "/close" is synchronous, and the caller is kept attached forever if the participant does not respond to "/complete". It would be better to establish a timeout and return a "Completing" status if not all participant are done in time.

      I attach few simple steps to reproduce it with shell commands.

        Gliffy Diagrams

          Attachments

            Issue Links

              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: