Savonitar commented on code in PR #28639:
URL: https://github.com/apache/flink/pull/28639#discussion_r3537220436


##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java:
##########
@@ -427,6 +430,14 @@ public CompletableFuture<RegistrationResponse> 
registerJobMaster(
                             jobMasterIdFuture,
                             (JobMasterGateway jobMasterGateway, JobMasterId 
leadingJobMasterId) -> {
                                 if (Objects.equals(leadingJobMasterId, 
jobMasterId)) {
+                                    // Register with the delegation token 
manager first; a
+                                    // provider failure rejects this 
registration so the job
+                                    // never starts without the tokens it 
requires.
+                                    try {
+                                        
delegationTokenManager.registerJob(jobId, jobConfiguration);
+                                    } catch (Exception e) {
+                                        return new 
RegistrationResponse.Failure(e);

Review Comment:
   One addition to my note above: that holds for an `Exception`, but an `Error` 
slips past both catches. The realistic trigger is a `NoClassDefFoundError` (or 
other `LinkageError` from provider plugin code), the same failure class 
`loadProviders` already has:
   ```
   } catch (Exception | NoClassDefFoundError e) {
                           // The intentional general rule is that if a 
provider's init method throws
                           // exception
                           // then stop the workload
                           LOG.error(
                                   "Failed to initialize delegation token 
provider {}",
                                   provider.serviceName(),
                                   e);
                           throw new FlinkRuntimeException(e);
                       }
   ```



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