nzw921rx opened a new pull request, #12987:
URL: https://github.com/apache/seatunnel/pull/12987

   ### Purpose of this pull request
   
   Yes, I am contributing to Apache SeaTunnel.
   
   Follow up on #11906 by removing a remaining scheduling race in 
`PythonSourceTest.testConcurrentCloseStopsBufferedBatchEmission`. The old latch 
fired before `reader.close()`, so sleeping for 50 ms did not guarantee 
cancellation had started. If the closing thread was delayed, the polling thread 
could resume and enter the uninitialized process-completion path instead of 
stopping after its first buffered row.
   
   ### Changes
   
   - Wait, within the existing five-second setup budget, until the closing 
thread is waiting for the collector-blocked poll before releasing that 
collector.
   - Release the collector and interrupt/join owned threads in `finally`, 
including assertion failures.
   - Preserve all five original assertions: both threads terminate, neither 
thread fails, and exactly one row is emitted.
   - Repeat the existing Python E2E job twice in the same engine, retaining its 
exact three-row and field assertions.
   
   Only two existing test files change. Production code, dependencies, 
configuration contracts and assertion thresholds are unchanged.
   
   ### How was this patch tested?
   
   - Controlled scheduling reproduction with current 3.1.0-SNAPSHOT 
dependencies: temporarily delay the closing thread by 200 ms before `close()`. 
The original synchronization fails; the corrected synchronization passes. The 
injected delay is absent from this commit.
   - JDK 11 and JDK 17: `./mvnw -B -nsu -pl :connector-python -DskipIT=true 
test` — 24 tests passed on each JDK, with no failures, errors or skips.
   - Final focused concurrent-close test passed without the injected delay.
   - Scoped Spotless and `git diff --check` passed.
   - The 11-module Python dependency reactor built successfully with tests 
skipped.
   
   E2E limitation: `PythonIT` compiled using cached 3.0.1-SNAPSHOT E2E 
dependencies, but its container remained in `apt-get update` while installing 
Python for over six minutes. The task-owned container was stopped and cleaned 
up before any Python job ran. Failsafe reported a startup failure; this is not 
an E2E pass. Current-head container E2E validation remains required.
   
   The Maven `verify` goal was not run because this workspace explicitly 
prohibits it.
   
   


-- 
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