flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2657: [FLINK-4853] [rm] Harden job manager registration ...
Date Fri, 21 Oct 2016 15:35:54 GMT
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<RegistrationResponse> registerJobMaster(
    -		final UUID resourceManagerLeaderId, final UUID jobMasterLeaderId,
    -		final String jobMasterAddress, final JobID jobID) {
    +	public Future<RegistrationResponse> 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?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message