You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/23 08:33:58 UTC

[GitHub] [flink] azagrebin commented on a change in pull request #11693: [FLINK-17072] Let Dispatcher and ResourceManager use random endpoint id

azagrebin commented on a change in pull request #11693:
URL: https://github.com/apache/flink/pull/11693#discussion_r413118874



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/standalone/StandaloneHaServices.java
##########
@@ -116,7 +108,7 @@ public LeaderRetrievalService getJobManagerLeaderRetriever(JobID jobID) {
 		synchronized (lock) {
 			checkNotShutdown();
 
-			return new StandaloneLeaderRetrievalService(jobManagerAddress, DEFAULT_LEADER_ID);
+			return new StandaloneLeaderRetrievalService("UNKNOWN", DEFAULT_LEADER_ID);

Review comment:
       I do not quite understand this change, why can it be `UNKNOWN`? Is it not used in `LeaderRetrievalListener#notifyLeaderAddress` or I miss something?

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
##########
@@ -466,6 +466,23 @@ public void terminationFutureDoesNotBlockRpcEndpointCreation() throws Exception
 		}
 	}
 
+	@Test
+	public void resolvesRunningAkkaRpcActor() throws Exception {
+		final String endpointName = "foobar";
+
+		try (SimpleRpcEndpoint simpleRpcEndpoint1 = new SimpleRpcEndpoint(akkaRpcService, AkkaRpcServiceUtils.createRandomName(endpointName));
+			SimpleRpcEndpoint simpleRpcEndpoint2 = new SimpleRpcEndpoint(akkaRpcService, AkkaRpcServiceUtils.createRandomName(endpointName))) {

Review comment:
       ```suggestion
   		try (RpcEndpoint simpleRpcEndpoint1 = createRpcEndpointWithRandomNameSuffix(endpointNamePrefix);
   			RpcEndpoint simpleRpcEndpoint2 = createRpcEndpointWithRandomNameSuffix(endpointNamePrefix)) {
   ```

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/rpc/akka/AkkaRpcActorTest.java
##########
@@ -466,6 +466,23 @@ public void terminationFutureDoesNotBlockRpcEndpointCreation() throws Exception
 		}
 	}
 
+	@Test
+	public void resolvesRunningAkkaRpcActor() throws Exception {
+		final String endpointName = "foobar";
+
+		try (SimpleRpcEndpoint simpleRpcEndpoint1 = new SimpleRpcEndpoint(akkaRpcService, AkkaRpcServiceUtils.createRandomName(endpointName));
+			SimpleRpcEndpoint simpleRpcEndpoint2 = new SimpleRpcEndpoint(akkaRpcService, AkkaRpcServiceUtils.createRandomName(endpointName))) {
+
+			simpleRpcEndpoint1.closeAsync().join();
+
+			final String wildcardName = AkkaRpcServiceUtils.createWildcardName(endpointName);
+			final String wildcardAddress = AkkaRpcServiceUtils.getLocalRpcUrl(wildcardName);
+			final RpcGateway rpcGateway = akkaRpcService.connect(wildcardAddress, RpcGateway.class).join();
+
+			assertThat(rpcGateway.getAddress(), is(equalTo(simpleRpcEndpoint2.getAddress())));

Review comment:
       btw, just a question:
   what would `RpcGateway/address` be if both endpoints were running?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org