-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow programmatic configuration of unicast relays. #498
Conversation
Friendly ping @caguero |
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.
By making Discovery::AddRelayAddress()
public, I think we now have risk for potential race conditions, as this->relayAddrs
can be modified from a user thread (via Node
) and the discovery thread can read the same variable via SendUnicast()
.
Should I add a new mutex to guard relayAddrs or just use the existing |
I think you can reuse |
Is there a performance concern to worry about re: serializing the user thread + discovery thread in the presence of unicast relays? Every unicast write would need to acquire that mutex. |
Thoughts on this test failure https://build.osrfoundation.org/job/gz_transport-pr-win/99/ ? I'm having a hard time figuring out how this PR would trigger behavior change on those tests. |
I'd expect a bit of impact if unicast is used because the mutex will be acquired when calling |
|
Friendly ping @caguero . |
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.
Minor comments.
Done. |
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.
Not sure why the ABI checker doesn't catch it but I think that changing the access right (from private to public in our case) in Discovery::AddRelayAddress()
breaks ABI.
I think the solution is to create a new public version of the function that calls the existing one.
Let's just target main? |
I think it's actually fine on Linux, it's only an issue with MSVC where the symbol mangling includes the access rights (Edit: but targeting main is easy, too) |
0c2f5ef
to
05d2529
Compare
This change allows users to configure relays from code without having to `setenv(GZ_RELAY)`. Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
Signed-off-by: Michael Beardsworth <[email protected]>
05d2529
to
811e865
Compare
@osrf-jenkins run tests |
Not sure why this |
Our CI was recently changed so that |
We do need to update the GitHub workflow to use Noble . @caguero would you mind doing that when you get a chance? |
This change allows users to configure relays from code without having to
setenv(GZ_RELAY)
.🎉 New feature
Summary
This change allows users to configure relays from code without having to
setenv(GZ_RELAY)
.Supersedes #497
Test it
This can be tested by starting a Node across a boundary where multicast isn't enabled, and setting the relay IP via NodeOptions.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.