lcx412 opened a new pull request, #30026: URL: https://github.com/apache/flink/pull/30026
JIRA: https://issues.apache.org/jira/browse/FLINK-41435 ## What is the purpose of the change The initial Hadoop delegation-token update currently runs on the thread that calls `DefaultDelegationTokenManager.start()`, while scheduled refreshes already run on the configured IO executor. On Kubernetes application startup this caller can be a Pekko `ForkJoinWorkerThread`. The provider then performs a blocking HDFS RPC while `freshUGI.doAs(...)` is effective; with Hadoop's `CompletableFuture`-based IPC wait path, `ForkJoinPool.managedBlock()` can create a replacement worker during that window. The new worker inherits the temporary Subject. ## Why this approach The initial update should use the same executor as the scheduled refreshes. Submitting it to `ioExecutor` creates or reuses a thread before `startTokensUpdate()` runs, so the provider is not executed on a `ForkJoinWorkerThread` and the blocking RPC cannot trigger FJP compensation from this path. `FutureTask.get()` keeps the existing synchronous `start()` semantics and deliberately avoids `CompletableFuture.get()`, which would itself enter the FJP managed-block path. This is a narrowly scoped fix: it does not change provider token-acquisition semantics or receiver target selection. ## Brief change log - Run the initial `startTokensUpdate()` on the configured IO executor. - Wait for completion with `FutureTask` so `start()` remains synchronous. - Add a unit test verifying the initial update executes on the IO executor. ## Verifying this change - `./mvnw -pl flink-runtime -Dtest=DefaultDelegationTokenManagerTest -DfailIfNoTests=false -Denforcer.skip=true test` - Tests run: 17, Failures: 0, Errors: 0, Skipped: 0 - Spotless and checkstyle passed as part of the targeted test run. ## 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 timing 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 -- 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]
