-
Notifications
You must be signed in to change notification settings - Fork 43
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
Retry router connection #135
Conversation
Signed-off-by: Yadunund <[email protected]>
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.
So I like the idea. However, there are two issues that I see here.
- I do think we should make this configurable through an environment variable. That is, I like this as a default behavior, but I think we should also allow the user to set the number of times to check (including maybe a way to disable the check completely).
- When I was testing this out with rclpy applications, I couldn't kill off the rclpy application. That is, I would run
ros2 run demo_nodes_py talker
with no router, and have it be in the loop saying "Unable to connect to a Zenoh router". But then hitting Ctrl-C would do nothing. Doing the same thing with rclcpp, I was able to kill off the application. This is likely a bug somewhere in rclpy, but it is a pretty poor user experience right now. Not sure what we should do about that.
Thanks for the feedback, Chris. Wondering if we should have two separate envars : one to decide whether or not to check for a router's presence and the other for retry count. Else we could have a single envar Regarding the rclpy issue, it wonder if its related to when we register signal handlers. We should definitely fix it but not a huge blocker imo since the user terminate with |
Alright I changed the implementation to be configurable via |
Signed-off-by: Yadunund <[email protected]>
3ff9448
to
704d206
Compare
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.
I really like the idea here. I've left one more piece of feedback, then I think we can get this in.
README.md
Outdated
| unset | Indefinitely waits for connection to a Zenoh router. | | ||
| <= 0 | Skips Zenoh router 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.
I'll suggest that we change this behavior slightly. In particular, if it is unset or 0
, then it indefinitely waits, and if it is less than 0, we skip the check. That feels a little more symmetric to me, and means that you can always set some value and get the behavior you want.
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.
Done 6366c9d
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
6df064a
to
6366c9d
Compare
Addresses #126
This PR updates
rmw_init()
such that it blocks until a Zenoh router is discovered inROUTER_CONNECTION_RETRY_MAX
attempts. For now this value is not externally configurable and is set tostd::numeric_limits<uint64_t>::max()
which effectively retries indefinitely.To test run a
talker
node without starting the router. The terminal should contain logs to remind the user to start the router. And once the router is started on a different terminal, execution should resume.Then