Skip to content

Conversation

@gbiggs
Copy link
Member

@gbiggs gbiggs commented Dec 14, 2022

This PR adds to rcl functionality necessary to support the improved handling of dynamic discovery.

It adds a new set of parameters for dynamic discovery, one for dynamic discovery range and one for static peers specification.

It removes the RMW_LOCALHOST_ONLY environment variable.

@ros-discourse
Copy link

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2023-02-16/29927/1

gbiggs and others added 6 commits March 21, 2023 12:58
Signed-off-by: Geoffrey Biggs <[email protected]>
Only print out the warning if it is actually specified.

Signed-off-by: Chris Lalancette <[email protected]>
Mostly to get rid of the use of strtok_r, which is dangerous
and also should not be used on our static environment variables.
Instead, use rcutils_split(), which is much better.

Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
mxgrey and others added 5 commits March 21, 2023 13:00
This commit adds support for dynamic allocation for unlimited number of
static peers.

Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
Copy link
Member

@audrow audrow left a comment

Choose a reason for hiding this comment

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

The logic makes sense and the tests seem thorough, so I'd think this is good to go with green CI.

arjo129 added 6 commits March 28, 2023 09:35
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
arjo129 and others added 15 commits March 28, 2023 15:12
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: William Woodall <[email protected]>
@wjwwood wjwwood requested a review from sloretz March 29, 2023 23:14
@sloretz sloretz changed the title Improve handling of dynamic discovery - rcl changes [rcl] Improve handling of dynamic discovery Mar 29, 2023
@sloretz sloretz merged commit cf6fafa into rolling Apr 8, 2023
@delete-merged-branch delete-merged-branch bot deleted the gbiggs/discovery-peers-specification branch April 8, 2023 04:35
achim-k pushed a commit to achim-k/rcl that referenced this pull request Apr 10, 2023
* Get discovery preferences from the environment

Signed-off-by: Geoffrey Biggs <[email protected]>

* Support specification of discovery range and static peers

Signed-off-by: Geoffrey Biggs <[email protected]>

* Add some debug helpers

Signed-off-by: Geoffrey Biggs <[email protected]>

* Cleanup the LOCALHOST_ONLY deprecation a bit.

Only print out the warning if it is actually specified.

Signed-off-by: Chris Lalancette <[email protected]>

* Rewrite parsing of static peers.

Mostly to get rid of the use of strtok_r, which is dangerous
and also should not be used on our static environment variables.
Instead, use rcutils_split(), which is much better.

Signed-off-by: Chris Lalancette <[email protected]>

* Fix some silly bugs.

Signed-off-by: Chris Lalancette <[email protected]>

* Use names instead of integers for discovery range env vars

Signed-off-by: Michael X. Grey <[email protected]>

* Add support for dynamic allocation

This commit adds support for dynamic allocation for unlimited number of
static peers.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add a warning if ROS_AUTOMATIC_DISCOVERY_OFF is set and STATIC_PEERS are
set.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Update to latest rmw API

Signed-off-by: Michael X. Grey <[email protected]>

* Uncrustify

Signed-off-by: Michael X. Grey <[email protected]>

* Update for rmw_discovery_options_t changes

Signed-off-by: Shane Loretz <[email protected]>

* Address feedback: use strncmp

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: Log levels

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: remove TODO

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: rename function

Signed-off-by: Arjo Chakravarty <[email protected]>

* ddress feedback: Docstring

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: comment

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add `RCL_RET_ERROR` if fini fails.

Signed-off-by: Arjo Chakravarty <[email protected]>

* `snprintf`->`rcutils_snprintf`

Signed-off-by: Arjo Chakravarty <[email protected]>

* Rename tests

Signed-off-by: Arjo Chakravarty <[email protected]>

* rcl_get_discovery_automatic_range -> rcl_get_automatic_discovery_range in test

Signed-off-by: Shane Loretz <[email protected]>

* Annotate tests

Signed-off-by: Arjo Chakravarty <[email protected]>

* More comments

Signed-off-by: Arjo Chakravarty <[email protected]>

* Style

Signed-off-by: Arjo Chakravarty <[email protected]>

* Style

Signed-off-by: Arjo Chakravarty <[email protected]>

* Uncrustify

Signed-off-by: Arjo Chakravarty <[email protected]>

* Constness and warning

Signed-off-by: Arjo Chakravarty <[email protected]>

* address TODO about IP address validation in the static peers

Signed-off-by: William Woodall <[email protected]>

* NOT_SET and SYSTEM_DEFAULT values

Signed-off-by: Shane Loretz <[email protected]>

* refactor discovery options to handle env vars better and simplify stringifying enums

Signed-off-by: William Woodall <[email protected]>

* fixup docs

Signed-off-by: William Woodall <[email protected]>

* (re)improve the discovery range debug message

Signed-off-by: William Woodall <[email protected]>

* Set discovery options to NOT_SET to detect user changse

Signed-off-by: Shane Loretz <[email protected]>

* lint

Signed-off-by: Shane Loretz <[email protected]>

* strncpy_s on windows

Signed-off-by: Shane Loretz <[email protected]>

* Change default range to SUBNET, and allow configuring it at build time

Signed-off-by: Shane Loretz <[email protected]>

---------

Signed-off-by: Geoffrey Biggs <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Co-authored-by: Michael X. Grey <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Shane Loretz <[email protected]>
Co-authored-by: William Woodall <[email protected]>
danthony06 pushed a commit to danthony06/rcl that referenced this pull request Jun 14, 2023
* Get discovery preferences from the environment

Signed-off-by: Geoffrey Biggs <[email protected]>

* Support specification of discovery range and static peers

Signed-off-by: Geoffrey Biggs <[email protected]>

* Add some debug helpers

Signed-off-by: Geoffrey Biggs <[email protected]>

* Cleanup the LOCALHOST_ONLY deprecation a bit.

Only print out the warning if it is actually specified.

Signed-off-by: Chris Lalancette <[email protected]>

* Rewrite parsing of static peers.

Mostly to get rid of the use of strtok_r, which is dangerous
and also should not be used on our static environment variables.
Instead, use rcutils_split(), which is much better.

Signed-off-by: Chris Lalancette <[email protected]>

* Fix some silly bugs.

Signed-off-by: Chris Lalancette <[email protected]>

* Use names instead of integers for discovery range env vars

Signed-off-by: Michael X. Grey <[email protected]>

* Add support for dynamic allocation

This commit adds support for dynamic allocation for unlimited number of
static peers.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add a warning if ROS_AUTOMATIC_DISCOVERY_OFF is set and STATIC_PEERS are
set.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Update to latest rmw API

Signed-off-by: Michael X. Grey <[email protected]>

* Uncrustify

Signed-off-by: Michael X. Grey <[email protected]>

* Update for rmw_discovery_options_t changes

Signed-off-by: Shane Loretz <[email protected]>

* Address feedback: use strncmp

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: Log levels

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: remove TODO

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: rename function

Signed-off-by: Arjo Chakravarty <[email protected]>

* ddress feedback: Docstring

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address feedback: comment

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add `RCL_RET_ERROR` if fini fails.

Signed-off-by: Arjo Chakravarty <[email protected]>

* `snprintf`->`rcutils_snprintf`

Signed-off-by: Arjo Chakravarty <[email protected]>

* Rename tests

Signed-off-by: Arjo Chakravarty <[email protected]>

* rcl_get_discovery_automatic_range -> rcl_get_automatic_discovery_range in test

Signed-off-by: Shane Loretz <[email protected]>

* Annotate tests

Signed-off-by: Arjo Chakravarty <[email protected]>

* More comments

Signed-off-by: Arjo Chakravarty <[email protected]>

* Style

Signed-off-by: Arjo Chakravarty <[email protected]>

* Style

Signed-off-by: Arjo Chakravarty <[email protected]>

* Uncrustify

Signed-off-by: Arjo Chakravarty <[email protected]>

* Constness and warning

Signed-off-by: Arjo Chakravarty <[email protected]>

* address TODO about IP address validation in the static peers

Signed-off-by: William Woodall <[email protected]>

* NOT_SET and SYSTEM_DEFAULT values

Signed-off-by: Shane Loretz <[email protected]>

* refactor discovery options to handle env vars better and simplify stringifying enums

Signed-off-by: William Woodall <[email protected]>

* fixup docs

Signed-off-by: William Woodall <[email protected]>

* (re)improve the discovery range debug message

Signed-off-by: William Woodall <[email protected]>

* Set discovery options to NOT_SET to detect user changse

Signed-off-by: Shane Loretz <[email protected]>

* lint

Signed-off-by: Shane Loretz <[email protected]>

* strncpy_s on windows

Signed-off-by: Shane Loretz <[email protected]>

* Change default range to SUBNET, and allow configuring it at build time

Signed-off-by: Shane Loretz <[email protected]>

---------

Signed-off-by: Geoffrey Biggs <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Michael X. Grey <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: William Woodall <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]>
Co-authored-by: Michael X. Grey <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Shane Loretz <[email protected]>
Co-authored-by: William Woodall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants