-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-38109] [flink-runtime] Fix BlobClient address when bindhost is set #26811
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
Conversation
@@ -1009,6 +1009,11 @@ public int getPort() { | |||
return this.serverSocket.getLocalPort(); | |||
} | |||
|
|||
@Override | |||
public InetAddress getAddress() { | |||
return this.serverSocket.getInetAddress(); |
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.
If BlobServer binds to 0.0.0.0
(wildcard address), serverSocket.getInetAddress()
returns 0.0.0.0
. However, clients cannot connect to 0.0.0.0
as it's not a routable address. Should we consider adding a check?
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.
Yes, this is a legitimate issue. Clients cannot use 0.0.0.0 for connections. Adding a check here to fallback to the local address sounds reasonable to me
@@ -43,4 +44,6 @@ public interface BlobService extends Closeable { | |||
* @return the port of the blob server. | |||
*/ | |||
int getPort(); | |||
|
|||
InetAddress getAddress(); |
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.
Adding a new method to the BlobService
interface is a breaking change for users who have custom implementations of this interface.Should we add or provide a default implementation?
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.
That sounds good to me. Added a default implementation and removed the unnecessary override so that it falls through to using the LoopbackAddress 👍
flink-runtime/src/test/java/org/apache/flink/runtime/blob/NoOpTaskExecutorBlobService.java
Outdated
Show resolved
Hide resolved
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.
While the existing tests have been updated to use getBlobServer().getAddress()
, there's no test that specifically reproduces the bug described in FLINK-38109.
Can u consider adding a test that verifies the fix works when BlobServer binds to a different address?
30c527f
to
93782b0
Compare
@Poorvankbhatia Thanks for the suggestion. I've added additional tests for the blobserver binding to a routable address and a configured address inherited by the JobManager bind-host. |
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.
LGTM.
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 your contribution @rosakng, and the thorough review @Poorvankbhatia! LGTM
https://issues.apache.org/jira/browse/FLINK-38109
What is the purpose of the change
The current implementation of BlobServer is to inherit the JobManager bind-host, however theres implicit assumptions that the BlobClient can use the dispatcher gateway host name.
This pull request surfaces the BlobServer hostname directly to the BlobClient, similar to how the BlobServer port works today.
Brief change log
Verifying this change
Updates the current BlobClientTest to use the BlobServer address instead of
localhost
.Additional tests added for blobserver binding to a routable address and a configured address inherited by the JobManager bind-host.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)no to all
Documentation
no
not applicable