lcx412 opened a new pull request, #30218: URL: https://github.com/apache/flink/pull/30218
JIRA: https://issues.apache.org/jira/browse/FLINK-41435 ## What is the purpose of the change This is the release-1.20 counterpart of #30026. On release-1.20, `DefaultDelegationTokenManager.start(Listener)` is called from `ResourceManager.onStart()` on a Pekko endpoint/ForkJoinPool thread. The initial `startTokensUpdate()` then runs the Hadoop provider's blocking HDFS RPC while `freshUGI.doAs(...)` is effective. With the Hadoop `CompletableFuture` IPC wait path, `ForkJoinPool.managedBlock()` can create a replacement worker during that window; the worker inherits the temporary Subject. Master no longer has this trigger after FLINK-41586 (#30043): `start()` moved to `ClusterEntrypoint.initializeServices()` and runs on the JVM main thread inside `SecurityContext.runSecured()`, and `ResourceManager` only attaches a listener. #30043 is a 2.5.0 lifecycle refactor and is not backported to 1.20, so release-1.20 still needs the minimal fix. ## Brief change log - Submit the initial `startTokensUpdate()` to the configured IO executor. - Wait with `FutureTask.get()` so `start()` stays synchronous and the caller does not enter `ForkJoinPool.managedBlock()`. - Add a unit test that verifies the initial update runs on the IO executor. ## Verifying this change - `./mvnw -pl flink-runtime -Dtest=DefaultDelegationTokenManagerTest -DfailIfNoTests=false -Denforcer.skip=true test` - Tests run: 14, Failures: 0, Errors: 0, Skipped: 0 - `./mvnw -pl flink-runtime spotless:apply` - `./mvnw -pl flink-runtime checkstyle:check` ## Does this pull request potentially affect one of the following parts - Dependencies: no - The public API: no - The serializers: no - The runtime per-record code paths: no - Anything that affects deployment or recovery: JobManager startup token acquisition runs on the IO executor; no checkpoint format or recovery protocol change - 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 (OpenAI Codex CLI) Generated-by: OpenAI Codex CLI -- 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]
