-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-31518][Runtime / REST] Fix StandaloneHaServices#getClusterRestEndpointLeaderRetreiver to return correct rest port #22308
base: master
Are you sure you want to change the base?
Conversation
5d495eb
to
9f958d0
Compare
@huwh please review the changes in free time |
...in/java/org/apache/flink/runtime/highavailability/nonha/standalone/StandaloneHaServices.java
Outdated
Show resolved
Hide resolved
…EndpointLeaderRetreiver to return correct rest port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for preparing this PR. I left some comments.
Currently there is no internal components in JobManager will call web monitor. So maybe we could not change the HighAvailableService and just update this configuration when WebMonitor is started is enough.
Then you can use ClientHighAvailabilityServices to retrieve the right web address and port.
And looking forward to your opinion @dannycranmer
@@ -176,6 +176,10 @@ public DispatcherResourceManagerComponent create( | |||
log.debug("Starting Dispatcher REST endpoint."); | |||
webMonitorEndpoint.start(); | |||
|
|||
configuration.setInteger(RestOptions.PORT, webMonitorEndpoint.getRestPort()); | |||
configuration.setString( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need update this Address?
"getServerAddress()" may produce NPE here.
|
||
return new StandaloneHaServices( | ||
resourceManagerRpcUrl, dispatcherRpcUrl, webMonitorAddress); | ||
resourceManagerRpcUrl, dispatcherRpcUrl, configuration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need these change if you use ClientHighAvailabilityServices to retrieve the rest address and port?
What is the purpose of the change
Currently,
StandaloneHaServices#getClusterRestEndpointLeaderRetreiver
returns wrong rest port when a range of ports is configured in rest.port. This patch addresses the same.Brief change log
DefaultDispatcherResourceManagerComponentFactory
sets the configuration with the rest address and rest port, from which theStandaloneHaServices#getClusterRestEndpointLeaderRetriever
retrieves the address and port.Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation