department-of-veterans-affairs / abd-vro

To get Veterans benefits in minutes, VRO software uses health evidence data to help fast track disability claims.
Other
19 stars 6 forks source link

EP Merge: Investigate/Fix possible bug in resume jobs logic #3208

Closed dfitchett closed 1 month ago

dfitchett commented 2 months ago

Summary

While investigating TTL behavior, I noticed some weird behavior that I'd like to look into regarding jobs that are in progress while EP Merge is starting.

Acceptance Criteria

dfitchett commented 2 months ago

Investigation

The following undesired behavior was noticed:

Steps to repeat:

  1. Start all platform services & BIP. Note BGS is not started to allow sending a requests during the same time
    COMPOSE_PROFILES="platform,bip" ./gradlew :dockerComposeUp
    COMPOSE_PROFILES="bip,bgs" ./gradlew -p mocks dockerComposeUp
  2. Within 5 seconds sent a merge request to the /merge endpoint with the following body:
    {
    "pending_claim_id": 10000,
    "ep400_claim_id": 10001
    }
  3. The request will be accepted and will likely run to the stage where the request is made to BGS to add the claim note.
  4. After the initial 5 seconds is up, the app will attempt to resume in-progress jobs and will log a statement showing event=resumeJobsInProgress status=started total=1
  5. The job with the same id as the request that was sent will be "resumed" in a separate thread and you'll see duplicate requests being sent for each step of the job process.