From issues-return-176911-archive-asf-public=cust-asf.ponee.io@flink.apache.org Thu Jul 12 11:31:09 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 D2F07180654 for ; Thu, 12 Jul 2018 11:31:08 +0200 (CEST) Received: (qmail 42948 invoked by uid 500); 12 Jul 2018 09:31:07 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 42939 invoked by uid 99); 12 Jul 2018 09:31:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jul 2018 09:31:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7184EC00DB for ; Thu, 12 Jul 2018 09:31:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, 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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id rFJ1fJdm8Xqq for ; Thu, 12 Jul 2018 09:31:02 +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 246CA5F117 for ; Thu, 12 Jul 2018 09:31: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 4A936E1024 for ; Thu, 12 Jul 2018 09:31: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 7BDC323FA5 for ; Thu, 12 Jul 2018 09:31:00 +0000 (UTC) Date: Thu, 12 Jul 2018 09:31:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (FLINK-9575) Potential race condition when removing JobGraph in HA 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/FLINK-9575?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated FLINK-9575: ---------------------------------- Labels: pull-request-available (was: ) > Potential race condition when removing JobGraph in HA > ----------------------------------------------------- > > Key: FLINK-9575 > URL: https://issues.apache.org/jira/browse/FLINK-9575 > Project: Flink > Issue Type: Bug > Affects Versions: 1.5.0 > Reporter: Dominik Wosi=C5=84ski > Assignee: Dominik Wosi=C5=84ski > Priority: Critical > Labels: pull-request-available > Fix For: 1.5.2, 1.6.0 > > > When we are removing the _JobGraph_ from=C2=A0_JobManager_=C2=A0for examp= le after invoking=C2=A0_cancel()_, the following code is executed :=C2=A0 > {noformat} > =C2=A0 > val futureOption =3D currentJobs.get(jobID) match { case Some((eg, _)) = =3D> val result =3D if (removeJobFromStateBackend) { val futureOption =3D S= ome(future { try { // ...otherwise, we can have lingering resources when th= ere is a concurrent shutdown // and the ZooKeeper client is closed. Not rem= oving the job immediately allow the // shutdown to release all resources. s= ubmittedJobGraphs.removeJobGraph(jobID) } catch { case t: Throwable =3D> lo= g.warn(s"Could not remove submitted job graph $jobID.", t) } }(context.disp= atcher)) try { archive ! decorateMessage( ArchiveExecutionGraph( jobID, Arc= hivedExecutionGraph.createFrom(eg))) } catch { case t: Throwable =3D> log.w= arn(s"Could not archive the execution graph $eg.", t) } futureOption } else= { None } currentJobs.remove(jobID) result case None =3D> None } // remove = all job-related BLOBs from local and HA store libraryCacheManager.unregiste= rJob(jobID) blobServer.cleanupJob(jobID, removeJobFromStateBackend) jobMana= gerMetricGroup.removeJob(jobID) futureOption } > val futureOption =3D currentJobs.get(jobID) match { > case Some((eg, _)) =3D> > val result =3D if (removeJobFromStateBackend) { > val futureOption =3D Some(future { > try { > // ...otherwise, we can have lingering resources when there is a concurre= nt shutdown > // and the ZooKeeper client is closed. Not removing the job immediately a= llow the > // shutdown to release all resources. > submittedJobGraphs.removeJobGraph(jobID) > } catch { > case t: Throwable =3D> log.warn(s"Could not remove submitted job graph $j= obID.", t) > } > }(context.dispatcher)) > try { > archive ! decorateMessage( > ArchiveExecutionGraph( > jobID, > ArchivedExecutionGraph.createFrom(eg))) > } catch { > case t: Throwable =3D> log.warn(s"Could not archive the execution graph $= eg.", t) > } > futureOption > } else { > None > } > currentJobs.remove(jobID) > result > case None =3D> None > } > // remove all job-related BLOBs from local and HA store > libraryCacheManager.unregisterJob(jobID) > blobServer.cleanupJob(jobID, removeJobFromStateBackend) > jobManagerMetricGroup.removeJob(jobID) > futureOption > }{noformat} > This causes the asynchronous removal of the job and synchronous removal o= f blob=C2=A0files connected with this jar. This means as far as I understan= d that there is a potential problem that we can fail to remove job graph fr= om _submittedJobGraphs._ If the JobManager fails and we elect the new leade= r it can try to recover such job, but it will fail with an exception since = the assigned blob was already removed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)