-
Notifications
You must be signed in to change notification settings - Fork 160
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
Cache disable flag to avoid reading environmental variable. #1029
Cache disable flag to avoid reading environmental variable. #1029
Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@clalancette minor performance improvement. this can avoid reading environmental variable every time it publishes data with using CC: @MichaelOrlov would be interested for you, as performance improvement. |
This reverts commit 2ed9454. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@clalancette requesting 2nd review, modification for test code is bigger than fix itself... |
can we backport this humble? probably not, since c structure is extended, this is API compatibility but ABI? |
https://build.ros2.org/job/Rpr__rcl__ubuntu_jammy_amd64/154/ is related to this PR, but cannot reproduce this failure on my local environment. @ros-pull-request-builder retest this please |
either @Barry-Xu-2018 or @iuhilnehc-ynos can you run the test with your local environment? I cannot reproduce the failure reported https://build.ros2.org/job/Rpr__rcl__ubuntu_jammy_amd64/159/. colcon test --event-handlers console_direct+ --packages-select rcl |
I can reproduce this issue in the It means the |
Ah, okay so using latest repo for rolling and CI should be fine. i will start the CI to verify. @iuhilnehc-ynos thanks for the information. @clalancette i thought Rpr job base runtime is updated nightly, but obviously it is not. How often does it get updated? |
Only when we do releases into Rolling. We are way overdue for that; we will spend some time next week doing releases into Rolling. |
Window is unstable, i will restart it later. |
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.
@fujitatomoya Thanks for moving to rcl_options and checking environment variable inside get_default_options methods. Implementation looks good to me.
However I have a question and suggestion for unit tests.
- Need to check that explicitly settled up value for the
publisher_options.disable_loaned_message
andsubscriber_options.disable_loaned_message
will not be overridden by the environment variable after calling pub/sub init. - And we shouldn't rely on default value of the environment variable. We should set environment variable explicitly for each test.
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@iuhilnehc-ynos can you review this? |
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.
@fujitatomoya Thanks for addressing comments from review.
I still have a strong opinion that we should not rely on default settings for ROS_DISABLE_LOANED_MESSAGES
environment variable in test_publisher_loan_disable
and test_subscription_loan_disable
when doing check for EXPECT_FALSE(publisher_options.disable_loaned_message);
right after reading default options.
We need either explicitly set environment variable in test or even better remove check for EXPECT_FALSE(publisher_options.disable_loaned_message);
after getting default options. And always forcefully set publisher_options.disable_loaned_message
value as we needed for test case.
The rationale for that is:
- It's not safe to rely (not reliable to assume) that
ROS_DISABLE_LOANED_MESSAGES
environment variable will not be set by default on testing machine and environment. It could be leftovers from another tests. It might work currently but could be broken in future if order of tests will be changed or some new tests would be added. - You've already have dedicated tests for checking
publisher_options.disable_loaned_message
after getting default options with different values of theROS_DISABLE_LOANED_MESSAGES
environment variable.
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.
LGTM with some minor comments.
@MichaelOrlov I see, probably it would be better, not to have flaky test 👍 |
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@MichaelOrlov @iuhilnehc-ynos thanks for the review, all comments are addressed. requesting final check. |
@iuhilnehc-ynos thanks for the review. CI(windows unstable): |
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.
@fujitatomoya Please remove logging to the stderr stream when rcl_get_disable_loaned_message(&disable_loaned_message) returning failure.
This is a normal situation when ROS_DISABLE_LOANED_MESSAGES
is not defined and ret != RCL_RET_OK
in this particular situation.
@clalancette i am putting a hold on this until #1029 (comment) is resolved. after rolling release, i will kick the Rpr job to make sure it passes, and then i will merge this into rolling. |
@ros-pull-request-builder retest this please |
rpr job is happy now, CI is green. @clalancette i will be waiting for the final review on this. |
@clalancette @MichaelOrlov @iuhilnehc-ynos thank you for the review, i will go ahead to merge this. since this changes ABI, this will be available on Iron or later. |
* Cache disable flag to avoid reading environmental variable. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Revert "Cache disable flag to avoid reading environmental variable." This reverts commit 2ed9454. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * extend pub/sub option to save loaned message disable flag. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * add more test cases. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * set env variable explicitly during loaned message test. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * add comments and error handling. Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> --------- Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
address #977
Signed-off-by: Tomoya Fujita Tomoya.Fujita@sony.com