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 "Ferenc Erdelyi (Jira)" <ji...@apache.org> on 2024/06/11 14:55:00 UTC

[jira] [Commented] (YARN-10379) Refactor ContainerExecutor exit code Exception handling

    [ https://issues.apache.org/jira/browse/YARN-10379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854085#comment-17854085 ] 

Ferenc Erdelyi commented on YARN-10379:
---------------------------------------

The source of the issue comes from an early design consideration. The abstract methods of the ContainerExecutor abstract class (like the init) are throwing IOException, hence all the implementations must also throw IOException. In practice, these methods rarely do any IO operation, which leads to catching YarnExceptions and rethrowing them as IOExceptions, just to satisfy the method signature. 

To correct this initial design hiccup, we would need to introduce the change to every class involved with the ContainerExecutor. This is a high-risk re-design with little benefit.

* High-risk, as we might introduce new bugs to the system. 
* Little benefit because it would only mean slightly easier debugging in a rather mature system and somewhat improved code readability.

Hence marking this Jira, as won't do.

> Refactor ContainerExecutor exit code Exception handling
> -------------------------------------------------------
>
>                 Key: YARN-10379
>                 URL: https://issues.apache.org/jira/browse/YARN-10379
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: yarn
>            Reporter: Benjamin Teke
>            Assignee: Ferenc Erdelyi
>            Priority: Minor
>
> **Currently every time a shell command is executed and returns with a non-zero exitcode an exception gets thrown. But along the call tree this exception gets catched, after some info/warn logging and other processing steps rethrown, possibly packaged to another exception. For example:
>  * from PrivilegedOperationExecutor.executePrivilegedOperation - ExitCodeException catch (as IOException), PrivilegedOperationException thrown
>  * then in LinuxContainerExecutor.startLocalizer - PrivilegedOperationException catch, exitCode collection, logging, IOException rethrown
>  * then in ResourceLocalizationService.run - generic Exception catch, but there is a TODO for separate ExitCodeException handling, however that information is only present here in an error message string
> This flow could be simplified and unified in the different executors. For example use one specific exception till the last possible step, catch it only where it is necessary and keep the exitcode as it could be used later in the process. This change could help with maintainability and readability.



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