You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/10/18 16:02:00 UTC

[jira] [Updated] (YARN-12028) DelegationTokenRenewer.DelegationTokenCancelThread should use ExitUtil instead of System.exit

     [ https://issues.apache.org/jira/browse/YARN-12028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated YARN-12028:
----------------------------------
    Labels: pull-request-available  (was: )

> DelegationTokenRenewer.DelegationTokenCancelThread should use ExitUtil instead of System.exit
> ---------------------------------------------------------------------------------------------
>
>                 Key: YARN-12028
>                 URL: https://issues.apache.org/jira/browse/YARN-12028
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: resourcemanager
>            Reporter: Jose Luis López
>            Assignee: Jose Luis López
>            Priority: Minor
>              Labels: pull-request-available
>
> {{DelegationTokenRenewer.DelegationTokenCancelThread.run()}} catches {{IOException}}, {{RuntimeException}} and {{InterruptedException}} separately, and calls {{System.exit(-1)}} for anything else:
> {code:java}
> } catch (InterruptedException ie) {
>   return;
> } catch (Throwable t) {
>   LOG.warn("Got exception " + StringUtils.stringifyException(t) +
>            ". Exiting..");
>   System.exit(-1);
> }
> {code}
> Exiting the RM when this thread hits an {{Error}} is intentional (YARN-690), but calling {{System.exit}} directly bypasses {{ExitUtil}}:
> * Tests that call {{ExitUtil.disableSystemExit()}} can't intercept it, so an {{Error}} thrown while cancelling a token in a test (for example an {{AssertionError}} from a mocked {{Token.cancel()}}) kills the surefire fork and the original failure is lost.
> * It is inconsistent with the rest of the RM, which already exits through {{ExitUtil.terminate()}} (for example in {{ResourceManager}}).
> * A fatal condition that terminates the RM is logged at WARN.
> *Proposed fix:*
> * Call {{ExitUtil.terminate(-1, t)}} instead of {{System.exit(-1)}}, keeping the exit behaviour from YARN-690.
> * Log the throwable at ERROR.
> * Add a test that an {{Error}} thrown while cancelling a token calls {{ExitUtil.terminate(-1, ...)}}.
> Similar to HADOOP-20010 ({{AbstractDelegationTokenSecretManager.ExpiredTokenRemover}}) and HADOOP-20022 ({{SecurityUtil.doAsLoginUserOrFatal}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org