Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5896#discussion_r185050544
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnTaskExecutorRunnerFactory.java
 ---
    @@ -73,61 +105,68 @@ public static void main(String[] args) {
                SignalHandler.register(LOG);
                JvmShutdownSafeguard.installAsShutdownHook(LOG);
     
    -           run(args);
    +           try {
    +                   SecurityUtils.getInstalledContext().runSecured(
    +                                   
YarnTaskExecutorRunnerFactory.create(System.getenv()));
    +           } catch (Exception e) {
    +                   LOG.error("Exception occurred while launching Task 
Executor runner", e);
    +                   throw new RuntimeException(e);
    +           }
        }
     
        /**
    -    * The instance entry point for the YARN task executor. Obtains user 
group information and calls
    -    * the main work method {@link 
TaskManagerRunner#runTaskManager(Configuration, ResourceID)}  as a
    -    * privileged action.
    +    * Creates a {@link YarnTaskExecutorRunnerFactory.Runner}.
         *
    -    * @param args The command line arguments.
    +    * @param envs environment variables.
         */
    -   private static void run(String[] args) {
    -           try {
    -                   LOG.debug("All environment variables: {}", ENV);
    +   @VisibleForTesting
    +   protected static Runner create(Map<String, String> envs) {
    +           LOG.debug("All environment variables: {}", envs);
     
    -                   final String yarnClientUsername = 
ENV.get(YarnConfigKeys.ENV_HADOOP_USER_NAME);
    -                   final String localDirs = 
ENV.get(Environment.LOCAL_DIRS.key());
    -                   LOG.info("Current working/local Directory: {}", 
localDirs);
    +           final String yarnClientUsername = 
envs.get(YarnConfigKeys.ENV_HADOOP_USER_NAME);
    +           final String localDirs = envs.get(Environment.LOCAL_DIRS.key());
    +           LOG.info("Current working/local Directory: {}", localDirs);
     
    -                   final String currDir = ENV.get(Environment.PWD.key());
    -                   LOG.info("Current working Directory: {}", currDir);
    +           final String currDir = envs.get(Environment.PWD.key());
    +           LOG.info("Current working Directory: {}", currDir);
     
    -                   final String remoteKeytabPath = 
ENV.get(YarnConfigKeys.KEYTAB_PATH);
    -                   LOG.info("TM: remote keytab path obtained {}", 
remoteKeytabPath);
    +           final String remoteKeytabPrincipal = 
envs.get(YarnConfigKeys.KEYTAB_PRINCIPAL);
    +           LOG.info("TM: remote keytab principal obtained {}", 
remoteKeytabPrincipal);
     
    -                   final String remoteKeytabPrincipal = 
ENV.get(YarnConfigKeys.KEYTAB_PRINCIPAL);
    -                   LOG.info("TM: remote keytab principal obtained {}", 
remoteKeytabPrincipal);
    -
    -                   final Configuration configuration = 
GlobalConfiguration.loadConfiguration(currDir);
    +           final Configuration configuration;
    +           try {
    +                   configuration = 
GlobalConfiguration.loadConfiguration(currDir);
                        FileSystem.initialize(configuration);
    +           } catch (Throwable t) {
    +                   LOG.error(t.getMessage(), t);
    --- End diff --
    
    Why is this exception being swallowed?


---

Reply via email to