Skip to content
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

Use UCP Listener for UCX connections and enable peer error handling #2886

Merged
merged 10 commits into from
Jul 10, 2021

Conversation

abellina
Copy link
Collaborator

@abellina abellina commented Jul 7, 2021

Closes #1590
Closes #2275
Closes #737

Created this as a draft because I may add more unit tests. But I could use some feedback on the patch. (I can't think of ways of adding tests without refactoring UCX.scala, so I am going to hold off).

This switches to use UCPListener as our incoming connection port, and enables peer error handling by default.

With this change, if a peer terminates the following is expected (@petro-rudenko please confirm):

  1. UCX will invoke the onError callback for each of the pending live requests.
  2. After the pending requests have been errored, UCX will call an extra error handler for the failed endpoint.

Because of how UCX works right now, a failing endpoint may or may not be of interest. We make an attempt to not initiate endpoints if we detect that we already had an endpoint created due to a peer initiating against us, but this is a race condition and in this PR we simply make one of those two endpoints win and be the default, while the other sticks around.

In the future: openucx/ucx#6859, we'll be able to better detect this (earlier) and reject certain requests.

@jlowe @petro-rudenko

@abellina abellina added the shuffle things that impact the shuffle plugin label Jul 7, 2021
@abellina abellina self-assigned this Jul 7, 2021
@abellina abellina added this to the July 5 - July 16 milestone Jul 7, 2021
Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
@abellina abellina force-pushed the shuffle/ucp_listener branch from 01a6431 to f3b7e35 Compare July 7, 2021 18:44
abellina added 2 commits July 8, 2021 13:05
Signed-off-by: Alessandro Bellina <abellina@nvidia.com>
hsBuff.putInt(localExecutorId)

def packHandshake(localExecutorId: Long, rkeys: Seq[ByteBuffer]): ByteBuffer = {
val size = 8 + 4 + (4 * rkeys.size) + rkeys.map(_.capacity).sum
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could use JDK constants java.lang.Long.BYTES + java.lang.Integer.BYTES for 8 + 4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this.

jlowe
jlowe previously approved these changes Jul 9, 2021
@abellina abellina marked this pull request as ready for review July 9, 2021 19:09
@abellina
Copy link
Collaborator Author

abellina commented Jul 9, 2021

I'll make the newMocks suggestion, seems simple enough.

@abellina
Copy link
Collaborator Author

abellina commented Jul 9, 2021

build

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jlowe
Copy link
Member

jlowe commented Jul 9, 2021

build

@abellina abellina merged commit 112b02d into NVIDIA:branch-21.08 Jul 10, 2021
@abellina abellina deleted the shuffle/ucp_listener branch July 10, 2021 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shuffle things that impact the shuffle plugin
Projects
None yet
3 participants