-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Restrict interface bindings and test connections #16292
Conversation
If this gets backported, does this mean every worker will have to be using the very latest version of julia to be able to communicate with the main node? What about workers that get updated but node 1 still uses an older point version of julia? Would both of those situations break? |
Yes.
We could port only the first commit, i.e., binding only to one interface to 0.4. That would only break the specific use case of a local addprocs followed by a remote one. Which can be fixed by specifying |
e925935
to
46f8cad
Compare
Ready for review. |
@@ -1204,6 +1204,7 @@ export | |||
# multiprocessing | |||
addprocs, | |||
asyncmap, | |||
cluster_cookie, |
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.
should this really be exported? it's kind of an internal detail
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.
Only required by folks writing their own ClusterManagers. But I guess we could document its use as Base. cluster_cookie()
|
||
Returns the cluster cookie. If a cookie is passed, also sets it as the cluster cookie. | ||
""" | ||
Base.cluster_cookie |
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.
better to do this inline rather than adding to this file
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.
Had it inline but moved it after removing the export since we cannot have the function definition as Base.cluster_cookie
.
Merging this in a short while if there are no major concerns. |
I wish you hadn't squashed this since the cookie part is not backwards compatible. Please open a separate PR against release-0.4 with the less breaking portion. |
Will keep this in mind in the future. For this patch though the first commit wouldn't have merged cleanly and we also need to update the manual. |
This PR does the following:
addprocs
restricts socket bindings to127.0.0.1
, the default ip or a specifiedbind-to
address. Currently we listen on all interfaces.addprocs(N)
by default binds only to127.0.0.1
.addprocs(N); addprocs(["some_host"])
will no longer work.addprocs(N; restrict=false); addprocs(["some_host"])
is the alternative for adding local workers and then adding workers from a remote host.SSHManager
now binds only to the specified ip or to the first interface ip returned bygetipaddr
.--worker <cookie>
.This PR addresses basic hygiene by avoiding unnecessary socket bindings and testing for connections. Full fledged security requirements are best addressed through a custom ClusterManager.
Doc updates are pending.