SEPURI-SAI-KRISHNA opened a new pull request, #29278:
URL: https://github.com/apache/flink/pull/29278
## What is the purpose of the change
`DefaultSchedulerTest` fails on CI in many methods: a job is `FAILED`
instead of `CANCELED` or `FINISHED`, the exception history has the wrong
entries, or `transitionToRunning` hits its `checkState`. It is the race from
FLINK-40682. The scheduler runs on `forMainThread()` but gets a real future
executor, so `Execution#deploy()` hands back to the main-thread executor from
that executor's thread, the thread assertion throws, and when the test thread
attaches the completion callback after that, the deployment fails with the
`AssertionError`. The uploaded core logs of five of the failing runs each show
a task going from DEPLOYING to FAILED with `java.lang.AssertionError`.
## Brief change log
- Give the schedulers built by `createSchedulerBuilder` a
`DirectScheduledExecutorService` as future executor, shut down in `tearDown`.
- `scheduledExecutorService` stays a real thread, because two tests use it
as their main thread. Making it direct instead adds a new main thread violation
in the slot pool of one of them.
## Verifying this change
- With TDD creation delayed on the executor and `deploy()` delayed before
`whenCompleteAsync`, the old class fails the same 18 methods in every run (5 of
5, two delay settings), including all 11 that failed on CI. 13 of the 16 CI
failures whose logs are still available fail at the same line, the other 3 a
few lines apart in the same methods. With the change it passes 51 of 51 in
every run (8 of 8), with no `AssertionError` in the logs.
- Breaking the exception history, the job created hook, the wait for
partition registration, or the blocking output check for savepoints fails the
same tests with and without the change.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **no**
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: **no**
- The serializers: **no**
- The runtime per-record code paths (performance sensitive): **no**
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: **no**
- The S3 file system connector: **no**
## Documentation
- Does this pull request introduce a new feature? **no**
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code (Opus 5)
--
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]