Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40CBEC7F2 for ; Mon, 24 Jun 2013 16:16:26 +0000 (UTC) Received: (qmail 10926 invoked by uid 500); 24 Jun 2013 16:16:19 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 10756 invoked by uid 500); 24 Jun 2013 16:16:14 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 10740 invoked by uid 99); 24 Jun 2013 16:16:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 16:16:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tucu@cloudera.com designates 209.85.160.41 as permitted sender) Received: from [209.85.160.41] (HELO mail-pb0-f41.google.com) (209.85.160.41) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 16:16:08 +0000 Received: by mail-pb0-f41.google.com with SMTP id rp16so11230529pbb.14 for ; Mon, 24 Jun 2013 09:15:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:content-transfer-encoding:subject:references:from :mime-version:in-reply-to:message-id:date:cc:to:x-mailer :x-gm-message-state; bh=287GKF629bDQo8H5ADrAuo3qL95ySC/aYf0dj4f8CtI=; b=kPaW0SiA1PmCmRh3DzZ+mrMxvFewPPYBzcSrpR1RR8sI2ZdFSrpkOnLFYqZ5jdNBOw b4rhVBHFfNwEvmts8tASSzJHJoAGKW1W48UJdMi3UuFXck08tgaB9WHLHFPXNMaPpbqq XFLC+z/U7HbNTfhpuID93aNEjtyBRzLhtErULHK7yBFlvaKr1PQmbOdMEBTRXUQFRcKt TcvCr/yMqN0XWc7Tlg30DglrlLs38lkyUVDPf4Zc5tpwbfx2OEiYiCGegfsbwKp6vAeX VoYP+xvhCNo+Dz5CW5X1s0QU/ZteEyAB8XKY8gjfOBEk85hcVc0BcGMJF0hfXH9aYmeK IOdQ== X-Received: by 10.68.164.97 with SMTP id yp1mr24298624pbb.77.1372090548512; Mon, 24 Jun 2013 09:15:48 -0700 (PDT) Received: from [21.237.83.200] (m832736d0.tmodns.net. [208.54.39.131]) by mx.google.com with ESMTPSA id dc3sm18827072pbc.9.2013.06.24.09.15.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 09:15:48 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-41FD25D5-EBA3-43E5-AD1F-D42702B583C7 Content-Transfer-Encoding: 7bit Subject: Re: Job end notification does not always work (Hadoop 2.x) References: <1371937095.36328.YahooMailNeo@web141205.mail.bf1.yahoo.com> <1371994239.84186.YahooMailNeo@web141205.mail.bf1.yahoo.com> <06006DDA5A27D541991944AC4117E7A96E1C83C5@szxeml560-mbx.china.huawei.com> From: Alejandro Abdelnur Mime-Version: 1.0 (1.0) In-Reply-To: <06006DDA5A27D541991944AC4117E7A96E1C83C5@szxeml560-mbx.china.huawei.com> Message-Id: <3AEF07D1-53AF-4D07-AB65-7072FBD65193@cloudera.com> Date: Mon, 24 Jun 2013 09:11:46 -0700 Cc: "user@hadoop.apache.org" To: "user@hadoop.apache.org" X-Mailer: iPhone Mail (10B329) X-Gm-Message-State: ALoCoQlQzNRVHw51AvRGWInUrLos/BFwi7m1QhPl0tV9IPR4AD5Vv6CjBErqxjSU2HafWnqneuww X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-41FD25D5-EBA3-43E5-AD1F-D42702B583C7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable if we ought to do this in a yarn service it=20 should be the RM or the HS. the RM is, IMO, the natural fit. the HS, would b= e a good choice if we are concerned about the extra work this would cause in= the RM. the problem with the current HS is that it is MR specific, we shoul= d generalize it for diff AM types.=20 thx Alejandro (phone typing) On Jun 23, 2013, at 23:28, Devaraj k wrote: > Even if we handle all the failure cases in AM for Job End Notification, we= may miss cases like abrupt kill of AM when it is in last retry. If we choos= e NM to give the notification, again RM needs to identify which NM should gi= ve the end-notification as we don't have any direct protocol between AM and N= M. > =20 > I feel it would be better to move End-Notification responsibility to RM as= Yarn Service because it ensures 100% notification and also useful for other= types of applications as well. > =20 > =20 > Thanks > Devaraj K > =20 > From: Ravi Prakash [mailto:ravihoo@ymail.com]=20 > Sent: 23 June 2013 19:01 > To: user@hadoop.apache.org > Subject: Re: Job end notification does not always work (Hadoop 2.x) > =20 > Hi Alejandro, >=20 > Thanks for your reply! I was thinking more along the lines Prashant sugges= ted i.e. a failure during init() should still trigger an attempt to notify (= by the AM). But now that you mention it, maybe we would be better of includi= ng this as a YARN feature after all (specially with all the new AMs being wr= itten). We could let the NM of the AM handle the notification burden, so tha= t the RM doesn't get unduly taxed. Thoughts? >=20 > Thanks > Ravi > =20 > =20 > From: Alejandro Abdelnur > To: "common-user@hadoop.apache.org" =20 > Sent: Saturday, June 22, 2013 7:37 PM > Subject: Re: Job end notification does not always work (Hadoop 2.x) > =20 > If the AM fails before doing the job end notification, at any stage of the= execution for whatever reason, the job end notification will never be deliv= er. There is not way to fix this unless the notification is done by a Yarn s= ervice. The 2 'candidate' services for doing this would be the RM and the HS= . The job notification URL is in the job conf. The RM never sees the job con= f, that rules out the RM out unless we add, at AM registration time the poss= ibility to specify a callback URL. The HS has access to the job conf, but th= e HS is currently a 'passive' service. >=20 > thx > =20 > On Sat, Jun 22, 2013 at 3:48 PM, Arun C Murthy wrote= : > Prashanth,=20 > =20 > Please file a jira. > =20 > One thing to be aware of - AMs get restarted a certain number of times fo= r fault-tolerance - which means we can't just assume that failure of a singl= e AM is equivalent to failure of the job. > =20 > Only the ResourceManager is in the appropriate position to judge failure o= f AM v/s failure-of-job. > =20 > hth, > Arun > =20 > On Jun 22, 2013, at 2:44 PM, Prashant Kommireddi wro= te: >=20 >=20 > Thanks Ravi. >=20 > Well, in this case its a no-effort :) A failure of AM init should be consi= dered as failure of the job? I looked at the code and best-effort makes sens= e with respect to retry logic etc. You make a good point that there would be= no notification in case AM OOMs, but I do feel AM init failure should send a= notification by other means. >=20 > =20 >=20 > On Sat, Jun 22, 2013 at 2:38 PM, Ravi Prakash wrote: > Hi Prashant, >=20 > I would tend to agree with you. Although job-end notification is only a "b= est-effort" mechanism (i.e. we cannot always guarantee notification for exam= ple when the AM OOMs), I agree with you that we can do more. If you feel str= ongly about this, please create a JIRA and possibly upload a patch. >=20 > Thanks > Ravi > =20 > =20 > From: Prashant Kommireddi > To: "user@hadoop.apache.org" =20 > Sent: Thursday, June 20, 2013 9:45 PM > Subject: Job end notification does not always work (Hadoop 2.x) > =20 > Hello, >=20 > I came across an issue that occurs with the job notification callbacks in M= R2. It works fine if the Application master has started, but does not send a= callback if the initializing of AM fails. >=20 > Here is the code from MRAppMaster.java >=20 > ..... > ....... > // set job classloader if configured > MRApps.setJobClassLoader(conf); > initAndStartAppMaster(appMaster, conf, jobUserName); > } catch (Throwable t) { > LOG.fatal("Error starting MRAppMaster", t); > System.exit(1); > } > } >=20 > protected static void initAndStartAppMaster(final MRAppMaster appMaster, > final YarnConfiguration conf, String jobUserName) throws IOException= , > InterruptedException { > UserGroupInformation.setConfiguration(conf); > UserGroupInformation appMasterUgi =3D UserGroupInformation > .createRemoteUser(jobUserName); > appMasterUgi.doAs(new PrivilegedExceptionAction() { > @Override > public Object run() throws Exception { > appMaster.init(conf); > appMaster.start(); > if(appMaster.errorHappenedShutDown) { > throw new IOException("Was asked to shut down."); > } > return null; > } > }); > } > appMaster.init(conf) does not dispatch JobFinishEventHandler which is resp= onsible for sending a HTTP callback (via shutDownJob()). If there was an exc= eption at this time, the process would simply terminate (via System.exit(1) )= >=20 > appMaster.start() however rightly uses the JobFinishEventHandler and thing= s work fine. >=20 > Shouldn't a failure on init(..) also send a callback suggesting the job fa= iled? >=20 > Thanks, > Prashant > =20 > =20 >=20 > =20 > =20 > -- > Arun C. Murthy > Hortonworks Inc. > http://hortonworks.com/ >=20 > =20 >=20 >=20 > =20 > --=20 > Alejandro > =20 --Apple-Mail-41FD25D5-EBA3-43E5-AD1F-D42702B583C7 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
if we ought to do this in a yarn service it 
should be the RM or the HS. the RM is, IMO, the natural fit. the HS, would be a good choice if we are concerned about the extra work this would cause in the RM. the problem with the current HS is that it is MR specific, we should generalize it for diff AM types. 

thx

Alejandro
(phone typing)

On Jun 23, 2013, at 23:28, Devaraj k <devaraj.k@huawei.com> wrote:

Even if we handle all the failure cases in AM for Job End Notification, we may miss cases like abrupt kill of AM when it is in last retry. If we choose NM to give the notification, again RM needs to identify which NM should give the end-notification as we don't have any direct protocol between AM and NM.

 

I feel it would be better to move End-Notification responsibility to RM as Yarn Service because it ensures 100% notification and also useful for other types of applications as well.

 

 

Thanks

Devaraj K

 

From: Ravi Prakash [mailto:ravihoo@ymail.com]
Sent: 23 June 2013 19:01
To: user@hadoop.apache.org
Subject: Re: Job end notification does not always work (Hadoop 2.x)

 

Hi Alejandro,

Thanks for your reply! I was thinking more along the lines Prashant suggested i.e. a failure during init() should still trigger an attempt to notify (by the AM). But now that you mention it, maybe we would be better of including this as a YARN feature after all (specially with all the new AMs being written). We could let the NM of the AM handle the notification burden, so that the RM doesn't get unduly taxed. Thoughts?

Thanks
Ravi

 

 


From: Alejandro Abdelnur <tucu@cloudera.com>
To: "common-user@hadoop.apache.org" <user@hadoop.apache.org>
Sent: Saturday, June 22, 2013 7:37 PM
Subject: Re: Job end notification does not always work (Hadoop 2.x)

 

If the AM fails before doing the job end notification, at any stage of the execution for whatever reason, the job end notification will never be deliver. There is not way to fix this unless the notification is done by a Yarn service. The 2 'candidate' services for doing this would be the RM and the HS. The job notification URL is in the job conf. The RM never sees the job conf, that rules out the RM out unless we add, at AM registration time the possibility to specify a callback URL. The HS has access to the job conf, but the HS is currently a 'passive' service.


thx

 

On Sat, Jun 22, 2013 at 3:48 PM, Arun C Murthy <acm@hortonworks.com> wrote:

Prashanth, 

 

 Please file a jira.

 

 One thing to be aware of - AMs get restarted a certain number of times for fault-tolerance - which means we can't just assume that failure of a single AM is equivalent to failure of the job.

 

 Only the ResourceManager is in the appropriate position to judge failure of AM v/s failure-of-job.

 

hth,

Arun

 

On Jun 22, 2013, at 2:44 PM, Prashant Kommireddi <prash1784@gmail.com> wrote:



Thanks Ravi.

Well, in this case its a no-effort :) A failure of AM init should be considered as failure of the job? I looked at the code and best-effort makes sense with respect to retry logic etc. You make a good point that there would be no notification in case AM OOMs, but I do feel AM init failure should send a notification by other means.

 

On Sat, Jun 22, 2013 at 2:38 PM, Ravi Prakash <ravihoo@ymail.com> wrote:

Hi Prashant,

I would tend to agree with you. Although job-end notification is only a "best-effort" mechanism (i.e. we cannot always guarantee notification for example when the AM OOMs), I agree with you that we can do more. If you feel strongly about this, please create a JIRA and possibly upload a patch.

Thanks
Ravi

 

 


From: Prashant Kommireddi <prash1784@gmail.com>
To: "user@hadoop.apache.org" <user@hadoop.apache.org>
Sent: Thursday, June 20, 2013 9:45 PM
Subject: Job end notification does not always work (Hadoop 2.x)

 

Hello,

I came across an issue that occurs with the job notification callbacks in MR2. It works fine if the Application master has started, but does not send a callback if the initializing of AM fails.

Here is the code from MRAppMaster.java

.....
.......

      // set job classloader if configured
      MRApps.setJobClassLoader(conf);
      initAndStartAppMaster(appMaster, conf, jobUserName);
    } catch (Throwable t) {
      LOG.fatal("Error starting MRAppMaster", t);
      System.exit(1);
    }
  }

protected static void initAndStartAppMaster(final MRAppMaster appMaster,
      final YarnConfiguration conf, String jobUserName) throws IOException,
      InterruptedException {
    UserGroupInformation.setConfiguration(conf);
    UserGroupInformation appMasterUgi = UserGroupInformation
        .createRemoteUser(jobUserName);
    appMasterUgi.doAs(new PrivilegedExceptionAction<Object>() {
      @Override
      public Object run() throws Exception {
        appMaster.init(conf);
        appMaster.start();
        if(appMaster.errorHappenedShutDown) {
          throw new IOException("Was asked to shut down.");
        }
        return null;
      }
    });
  }

appMaster.init(conf) does not dispatch JobFinishEventHandler which is responsible for sending a HTTP callback (via shutDownJob()). If there was an exception at this time, the process would simply terminate (via System.exit(1) )

appMaster.start() however rightly uses the JobFinishEventHandler and things work fine.

Shouldn't a failure on init(..) also send a callback suggesting the job failed?

Thanks,

Prashant

 

 

 

 

--

Arun C. Murthy

Hortonworks Inc.
http://hortonworks.com/

 



 

--
Alejandro

 

--Apple-Mail-41FD25D5-EBA3-43E5-AD1F-D42702B583C7--