From issues-return-75528-apmail-flink-issues-archive=flink.apache.org@flink.apache.org Fri Oct 21 15:36:00 2016 Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9636219F65 for ; Fri, 21 Oct 2016 15:36:00 +0000 (UTC) Received: (qmail 47889 invoked by uid 500); 21 Oct 2016 15:36:00 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 47747 invoked by uid 500); 21 Oct 2016 15:36:00 -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 47516 invoked by uid 99); 21 Oct 2016 15:36:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2016 15:36:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 131882C0B04 for ; Fri, 21 Oct 2016 15:36:00 +0000 (UTC) Date: Fri, 21 Oct 2016 15:36:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4853) Clean up JobManager registration at the ResourceManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-4853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15595450#comment-15595450 ] ASF GitHub Bot commented on FLINK-4853: --------------------------------------- Github user mxm commented on a diff in the pull request: https://github.com/apache/flink/pull/2657#discussion_r84500271 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java --- @@ -202,101 +205,125 @@ public void shutDown() throws Exception { // RPC methods // ------------------------------------------------------------------------ - /** - * Register a {@link JobMaster} at the resource manager. - * - * @param resourceManagerLeaderId The fencing token for the ResourceManager leader - * @param jobMasterAddress The address of the JobMaster that registers - * @param jobID The Job ID of the JobMaster that registers - * @return Future registration response - */ @RpcMethod - public Future registerJobMaster( - final UUID resourceManagerLeaderId, final UUID jobMasterLeaderId, - final String jobMasterAddress, final JobID jobID) { + public Future registerJobManager( + final UUID resourceManagerLeaderId, + final UUID jobManagerLeaderId, + final String jobManagerAddress, + final JobID jobId) { + + checkNotNull(resourceManagerLeaderId); + checkNotNull(jobManagerLeaderId); + checkNotNull(jobManagerAddress); + checkNotNull(jobId); + + if (isValid(resourceManagerLeaderId)) { + if (!jobLeaderIdService.containsJob(jobId)) { + try { + jobLeaderIdService.addJob(jobId); + } catch (Exception e) { + // This should actually never happen because, it should always be possible to add a new job + ResourceManagerException exception = new ResourceManagerException("Could not add the job " + + jobId + " to the job id leader service. This should never happen.", e); + + onFatalErrorAsync(exception); + + log.debug("Could not add job {} to job leader id service.", jobId, e); --- End diff -- Should this be logged on `error` level? > Clean up JobManager registration at the ResourceManager > ------------------------------------------------------- > > Key: FLINK-4853 > URL: https://issues.apache.org/jira/browse/FLINK-4853 > Project: Flink > Issue Type: Sub-task > Components: ResourceManager > Reporter: Till Rohrmann > Assignee: Till Rohrmann > > The current {{JobManager}} registration at the {{ResourceManager}} blocks threads in the {{RpcService.execute}} pool. This is not ideal and can be avoided by not waiting on a {{Future}} in this call. > I propose to encapsulate the leader id retrieval operation in a distinct service so that it can be separated from the {{ResourceManager}}. This will reduce the complexity of the {{ResourceManager}} and make the individual components easier to test. -- This message was sent by Atlassian JIRA (v6.3.4#6332)