zhangshenghang opened a new pull request, #13442:
URL: https://github.com/apache/seatunnel/pull/13442
Yes, I am contributing to Apache SeaTunnel. This change only adds regression
coverage to the Zeta engine E2E suite; no production code is modified.
### What this PR does
Adds
`SplitClusterPendingJobLifecycleFailoverIT#testCancelPendingJobKeepsItTerminalAndDoesNotStrandCapacity`,
an end-to-end test for cancelling a job that is still `PENDING` because the
only worker's fixed slots are occupied.
Contract under test:
1. After the client cancel returns, the pending job is `CANCELED` (not left
`PENDING`/`CANCELING`), is removed from the master's pending queue, and the
master's job-status view reports it terminal.
2. Cancelling it again is idempotent (no error, no status regression).
3. When the holder job releases all slots, the cancelled job must stay
`CANCELED` for a full observation window, must never re-enter the pending
queue, and must not appear in `engine_ownedSlotProfilesIMap` (a late deployment
would register its pipeline there even if the job-level status stayed
`CANCELED`).
4. A replacement job that needs the same four fixed slots must reach
`RUNNING`; fixed-slot capacity is inelastic, so any slot stranded by the cancel
leaves it `PENDING` and fails the test instead of leaking silently.
### Why this boundary has real regression risk
A pending job is not an inert queue entry:
`CoordinatorService#pendingJobSchedule` is concurrently pre-applying its
resources every retry interval, and the `JobMaster` behind it already owns the
job-end future and checkpoint manager. The dangerous failure mode is a zombie:
the cancel removes the job from `pendingJobQueue` while an in-flight scheduler
attempt continues, freed slots are later acquired for a job the client believes
is `CANCELED`, and replacement work is starved. Fixed slots make that leak
permanent until the worker restarts. This is the job-scoped terminal-cleanup
area tracked in #13344 (related, not closed by this PR).
### Why existing coverage does not reach it
- `CoordinatorServiceWithCancelPendingJobTest` builds a `JobMaster`
directly, calls `CoordinatorService#cancelJob` in-process, and asserts
queue/IMap cleanup. It never goes through the client protocol, never competes
for real worker slots, and never observes what happens when capacity is freed
afterwards.
- `testPendingJobScheduledAfterRunningJobCanceled` covers the opposite
direction: the pending job survives and the running job is cancelled.
- Neither proves the cancelled pending job stays terminal while the WAIT
scheduler is actively retrying it, nor that a later job actually gets the
released slots.
### Verification
```
mvn -pl seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base
verify \
-DskipIT=false \
-Dit.test='SplitClusterPendingJobLifecycleFailoverIT#testCancelPendingJobKeepsItTerminalAndDoesNotStrandCapacity'
\
-DfailIfNoTests=false -DskipTests=false
```
- Passed 3 consecutive runs on `dev` (85c150df16), ~29s per run, including
the committed revision.
- `mvn -pl .../connector-seatunnel-e2e-base spotless:check` passes.
- Searched open/closed PRs and issues for an equivalent test; none found.
--
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]