You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "elphastori (via GitHub)" <gi...@apache.org> on 2023/04/04 00:47:11 UTC

[GitHub] [flink] elphastori commented on a diff in pull request #22308: [FLINK-31518][Runtime / REST] Fix StandaloneHaServices#getClusterRestEndpointLeaderRetreiver to return correct rest port

elphastori commented on code in PR #22308:
URL: https://github.com/apache/flink/pull/22308#discussion_r1156594224


##########
flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/standalone/StandaloneHaServices.java:
##########
@@ -134,9 +136,13 @@ public LeaderElectionService getJobManagerLeaderElectionService(JobID jobID) {
     }
 
     @Override
-    public LeaderRetrievalService getClusterRestEndpointLeaderRetriever() {
+    public LeaderRetrievalService getClusterRestEndpointLeaderRetriever()
+            throws UnknownHostException {
         synchronized (lock) {
             checkNotShutdown();
+            String clusterRestEndpointAddress =
+                    HighAvailabilityServicesUtils.getWebMonitorAddress(
+                            configuration, AddressResolution.NO_ADDRESS_RESOLUTION);

Review Comment:
   Why have you moved the call to `getWebMonitorAddress` inside this method? Is it to have it after `checkNotShutdown()` or to have it in a synchronized block?
   
   Having the check in a lock may result reduced performance and there may be no need for thread safety since it's only a read operation.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

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