shihchengwei-lab commented on PR #13516:
URL: https://github.com/apache/seatunnel/pull/13516#issuecomment-7231904217

   **A delayed duplicate can still start a second admission after the first 
entry is removed.**
   
   At `38ea5700add97c055a8a18d50abb385311b0962f`, I paused submission B after 
it observed `getJobMaster(jobId) == null`, then let submission A publish its 
`JobMaster` and remove its in-flight entry. When B resumed, its `putIfAbsent` 
succeeded because the entry was gone. Since the published job is not checked 
again after the claim, B started another admission for the same job id.
   
   With this ordering, the job remained `RUNNING` after the test’s 120-second 
limit. The current eight-client test does not pin this window because its 
callers normally reach `putIfAbsent` while A’s entry still exists.
   
   Could a successful claimant recheck `getJobMaster(jobId)` before dispatching 
admission and release its claim when the job is already visible?
   
   <details>
   <summary>Minimal reproduction</summary>
   
   I added test-only gates to the existing `ConcurrentDuplicateSubmissionIT`:
   
   ```text
   B: getJobMaster(jobId) returns null
   B: pause before putIfAbsent
   
   A: submit the same job id
   A: publish the JobMaster
   A: remove its in-flight entry
   
   B: resume
   ```
   
   Run:
   
   ```sh
   ./mvnw -q \
     -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base \
     -am \
     -DskipUT=true \
     -DskipIT=false \
     -Dit.test=ConcurrentDuplicateSubmissionIT \
     -DfailIfNoTests=false \
     verify
   ```
   
   Result:
   
   ```text
   expected: <FINISHED> but was: <RUNNING>
   Tests run: 1, Failures: 0, Errors: 1
   ```
   
   The run used JDK 17 in a clean Docker container without host directories or 
credentials mounted.
   
   </details>
   
   *Disclosure: AI helped review the concurrency path, design the fixed-order 
reproduction, and draft this comment.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to