MartijnVisser opened a new pull request, #28694:
URL: https://github.com/apache/flink/pull/28694

   ## What is the purpose of the change
   
   `YARNSessionFIFOSecuredITCase.testDetachedMode` is flaky on `master` since 
FLINK-40099, failing with `FlinkException: Exhausted retry attempts.` (e.g. 
[GHA run 
29005398820](https://github.com/apache/flink/actions/runs/29005398820/job/86077406039),
 module `misc`).
   
   FLINK-40099 moved the Kerberos keytab log verification into a callback that 
runs after the job reaches FINISHED but **before the application is killed**, 
polling `waitUntilCondition(condition, 500)`. Two problems:
   
   1. The `500` `int` literal binds to the `waitUntilCondition(condition, int 
retryAttempts)` overload (500 attempts × 100ms, then `"Exhausted retry 
attempts."`) rather than the intended millisecond interval.
   2. More fundamentally, reading the JobManager log while the application is 
still alive is racy. The in-scope `jobmanager.log` does not reliably contain 
the keytab login line before teardown: the bootstrap output that carries the 
login line and the running-JobManager output land in different files, and the 
pre-kill content is not durably readable. The keytab line **is** present once 
the application has been torn down and its logs flushed.
   
   The original FLINK-17662 concern (a short-lived TaskManager's startup login 
line being briefly unreadable shortly after teardown) is real, but the fix for 
it should be a bounded post-kill poll, not relocating the check to before the 
kill.
   
   ## Brief change log
   
     - Revert FLINK-40099's pre-kill verification callback in 
`YARNSessionFIFOITCase.runDetachedModeTest` (remove the `ThrowingConsumer` 
overload); the base test is unchanged.
     - In `YARNSessionFIFOSecuredITCase`, verify the keytab logs after the 
application is killed (as before FLINK-40099), but replace the original single 
read with a bounded `CommonTestUtils.waitUtil(...)` poll that fails with a 
message naming the log file and the expected strings. This absorbs the 
FLINK-17662 durability lag without the pre-kill race.
   
   ## Verifying this change
   
   This change is already covered by the existing 
`YARNSessionFIFOSecuredITCase`. A genuine regression still fails: if the keytab 
login strings never appear, the bounded poll times out with a message naming 
the log file and strings, and the uploaded container logs allow diagnosing 
whether the file was absent or the string was missing.
   
   ## 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: Claude Opus 4.8 (1M context)
   


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