-
Notifications
You must be signed in to change notification settings - Fork 166
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
Question about conditional statements in graph.c file #934
Comments
For context, directing you to #907 where this change was merged. |
I don't have much context, but I'm quoting a section from the Lines 596 to 597 in 7b899da
Note that Lines 594 to 611 in 7b899da
With it passing in the Line 486 in 7b899da
Not sure if that addresses your question though. Let me know! |
I looked at all the connected functions as well. Lines 484 to 494 in 7b899da
I understand this comment. If there are already the expected number of entities(There is a typo in the comments, not only publishers), we don't have to wait. I don't think there are any particular problems with normal use. rcl/rcl/test/rcl/test_graph.cpp Lines 820 to 831 in 7b899da
According to the comments in the code block above, wait for a certain value of the number of publishers or subscribers. |
If I may rephrase your thoughts: the concern is that there may be kind of a "race" between |
Let me summarize. In this case, I think it is right to wait for
But by the above condition(0<=1) return OK immediately, so As I think, I changed the condition to the following
and ran the test, and it was confirmed that it was successful. |
I totally see why you proposed this, but what if |
@YoungJin-gurum thanks for the explanation.
I believe that Lines 621 to 622 in eae50c9
true, this cannot test if the entity is actually changed into 0 (specified number) precisely. as you pointed out, that was the purpose for this test case. I would use
could you tell us where? |
I believe the typo in question is inside Lines 484 to 486 in 7b899da
I guess this also addresses @YoungJin-gurum's concern about the mismatch between |
@fujitatomoya galactic branch also needs the patch, I think. |
I am not inclined to do that unless we have the actual problem. |
Bug report
Required Info:
Steps to reproduce issue
Expected behavior
rcl test_graph_query_functions
At check_graph_state after subscription fini
expected_in_tnat result passed (expect topic isn't in tnat)
Actual behavior
failed
Additional information
I have a question about the code at line 491 and 548 of <graph.c>
Variable count is result of count_entities_func.
After entity fini, if it has not yet received signal of deleted entity, count will be 1.
Then the condition is satisfied (expected_count 0 <= count 1).
So it will return OK immediately, then rcl_get_topic_names_and_types gets topic_cahce.
As I think, condition should be changed to
I think that makes waitset operate normally until the graph changes.
If there is a valid reason for the inequality sign in the conditional statement, please let me know.
The text was updated successfully, but these errors were encountered: