From yarn-issues-return-142533-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Mon Apr 16 18:33:11 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id BAB5A180608 for ; Mon, 16 Apr 2018 18:33:10 +0200 (CEST) Received: (qmail 68109 invoked by uid 500); 16 Apr 2018 16:33:04 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 68092 invoked by uid 99); 16 Apr 2018 16:33:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Apr 2018 16:33:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3D440C606C for ; Mon, 16 Apr 2018 16:33:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id t4m-9Nvd4Kw4 for ; Mon, 16 Apr 2018 16:33:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7B7CD5FB94 for ; Mon, 16 Apr 2018 16:33:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2B903E0309 for ; Mon, 16 Apr 2018 16:33:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 74DDB241D6 for ; Mon, 16 Apr 2018 16:33:00 +0000 (UTC) Date: Mon, 16 Apr 2018 16:33:00 +0000 (UTC) From: "Eric Badger (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-6495) check docker container's exit code when writing to cgroup task files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-6495?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16439= 690#comment-16439690 ]=20 Eric Badger commented on YARN-6495: ----------------------------------- Hey [~Jaeboo], thanks for the patch update {noformat} + // write pid to cgroups + char* const* cgroup_ptr; + int docker_exit_code =3D 0; + for (cgroup_ptr =3D resources_values; cgroup_ptr !=3D NULL && + *cgroup_ptr !=3D NULL; ++cgroup_ptr) { + if (strcmp(*cgroup_ptr, "none") !=3D 0 && + write_pid_to_cgroup_as_root(*cgroup_ptr, pid) !=3D 0) { + docker_exit_code =3D check_docker_exit_code(docker_binary, conta= iner_id); + if (docker_exit_code !=3D 0) { + exit_code =3D docker_exit_code; + goto cleanup; + } else { + exit_code =3D WRITE_CGROUP_FAILED; + goto cleanup; + } + } + } {noformat} This is semantically different from the previous version of the patch in th= at now failed cgroup writes will always cause an error. When the cgroup wri= te fails due to {{no such process}}, but the docker exit code is 0, we want= to continue on without error.=20 Additionally, as of now, there is currently no support in {{write_pid_to_cg= roup_as_root()}} to differentiate between an error due to {{no such process= }} or a different type of error (opening the files or changing effective us= er). On the former, we want to ignore the cgroup write error so long as the= docker exit code is 0. On the latter, we want to fail regardless of the do= cker outcome.=20 > check docker container's exit code when writing to cgroup task files > -------------------------------------------------------------------- > > Key: YARN-6495 > URL: https://issues.apache.org/jira/browse/YARN-6495 > Project: Hadoop YARN > Issue Type: Sub-task > Components: nodemanager > Reporter: Jaeboo Jeong > Assignee: Jaeboo Jeong > Priority: Major > Attachments: YARN-6495.001.patch, YARN-6495.002.patch > > > If I execute simple command like date on docker container, the applicatio= n failed to complete successfully. > for example,=20 > {code} > $ yarn jar $HADOOP_HOME/share/hadoop/yarn/hadoop-yarn-applications-distr= ibutedshell-2.7.1.jar -shell_env YARN_CONTAINER_RUNTIME_TYPE=3Ddocker -shel= l_env YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=3Dhadoop-docker -shell_command "d= ate" -jar $HADOOP_HOME/share/hadoop/yarn/hadoop-yarn-applications-distribut= edshell-2.7.1.jar -num_containers 1 -timeout 3600000 > =E2=80=A6 > 17/04/12 00:16:40 INFO distributedshell.Client: Application did finished = unsuccessfully. YarnState=3DFINISHED, DSFinalStatus=3DFAILED. Breaking moni= toring loop > 17/04/12 00:16:40 ERROR distributedshell.Client: Application failed to co= mplete successfully > {code} > The error log is like below. > {code} > ... > Failed to write pid to file /cgroup_parent/cpu/hadoop-yarn/container_xxxx= /tasks - No such process > ... > {code} > When writing pid to cgroup tasks, container-executor doesn=E2=80=99t chec= k docker container=E2=80=99s status. > If the container finished very quickly, we can=E2=80=99t write pid to cgr= oup tasks, and it is not problem. > So container-executor needs to check docker container=E2=80=99s exit code= during writing pid to cgroup tasks. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org