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

always check if the service is available, even if the graph event wasn't triggered #262

Merged
merged 3 commits into from
Oct 29, 2016

Conversation

wjwwood
Copy link
Member

@wjwwood wjwwood commented Oct 27, 2016

This is needed to avoid the race condition that is specific to our Connext code, outlined in this issue:

ros2/rmw_connext#201

Basically the assumption "we only need to check the service is available function after a graph event because the state can only change after the graph event is triggered" does not hold. As there is apparently a race between setting the graph event and the underlying state reflecting the full change.

Connects to ros2/rmw_connext#168

@wjwwood wjwwood added the in progress Actively being worked on (Kanban column) label Oct 27, 2016
return true;
}
event->check_and_clear(); // reset the event
if (this->service_is_ready()) { // check if the service is ready regardless
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment won't be clear once the context of this PR/commit is lost

Copy link
Member Author

Choose a reason for hiding this comment

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

regardless of the event state?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe

// always check if the service is ready, even if the graph event wasn't triggered
// (see https://github.com/ros2/rmw_connext/issues/201)

unless that's then too specific.

Copy link
Member

Choose a reason for hiding this comment

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

(I know this is captured in the commit message but that can get annoying to track down once the files get moved around)

Copy link
Member Author

Choose a reason for hiding this comment

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

For sure, I'm always in favor of more descriptive comments, can you push that change?

@wjwwood wjwwood merged commit 7494350 into master Oct 29, 2016
@wjwwood wjwwood deleted the local_graph_changes branch October 29, 2016 01:31
@wjwwood wjwwood removed the in progress Actively being worked on (Kanban column) label Oct 29, 2016
Karsten1987 pushed a commit that referenced this pull request Dec 7, 2016
…n't triggered (#262)

* always check if the service is available, even if the graph event wasn't triggered

* more descriptive comment

* Even more descriptive in case the link ever breaks
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* Add badge for license
* Add badge for build and test

Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
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.

3 participants