gauthamsankar-confluent opened a new pull request, #30165:
URL: https://github.com/apache/flink/pull/30165
## What is the purpose of the change
`TaskFailureITCase` is flaky. It fails with "Expecting Optional to contain a
value but it was
empty", caused by "Job restarted" (seen in the nightly AdaptiveScheduler run,
`testJobWithoutObjectReuse`). It affects 2.2.2 and 2.4.0.
The test runs a job whose first attempt fails on purpose and is restarted.
Without checkpointing
the collect iterator cannot recover its position after a restart, so it
throws "Job restarted".
This happens when the client polls attempt 0's sink in the ~20 ms between
the sink becoming
reachable and the mapper throwing, and then sees attempt 1's different sink
version. The test
then does not find the expected `Test Exception:1` in the cause chain. This
is a timing race in
the test configuration, not a scheduler bug.
## Brief change log
- Enable at-least-once checkpointing in `TaskFailureITCase#executeTask`. On
a sink version change
the collect iterator now resets its buffer and the real failure of the
last attempt is reported
regardless of timing. The 10 minute interval means no checkpoint runs
during the test.
## Verifying this change
This change is a test-only fix, covered by the existing `TaskFailureITCase`.
The natural flake could not be reproduced in CI or locally, so I verified
the cause and the fix
locally by widening the race window (all runs with
`-Penable-adaptive-scheduler`):
- A local reproduction test (not part of this PR) keeps attempt 0 alive for
1 s, so the client
always learns attempt 0's sink version before the restart. It uses the
same assertion as
`TaskFailureITCase#testProgram`:
- no checkpointing: fails with the same message as the nightly failure
("Job restarted")
- at-least-once checkpointing: passes, `Test Exception:1` is in the cause
chain
- exactly-once checkpointing: passes, `Test Exception:1` is in the cause
chain
- `TaskFailureITCase` with this change: 20/20 local runs passed. This is
weak evidence on its own,
because the unmodified test also passed 20/20 locally.
## 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
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: IBM Bob
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]