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

Unique Client GID for Service Introspectino Event. #779

Merged

Conversation

fujitatomoya
Copy link
Collaborator

part of ros2/rmw#357

@fujitatomoya
Copy link
Collaborator Author

@MiguelCompany i would like to know what you think about this fix, could you take a look?

@fujitatomoya
Copy link
Collaborator Author

This PR fixes the issue ros2/rmw#357

info:
  event_type: 0
  stamp:
    sec: 1726873574
    nanosec: 967201238
  client_gid: [1, 15, 163, 43, 147, 68, 18, 20, 0, 0, 0, 0, 0, 0, 21, 3]
  sequence_number: 1829
request: [{a: 2, b: 3}]
response: []
---
info:
  event_type: 1
  stamp:
    sec: 1726873574
    nanosec: 967516329
  client_gid: [1, 15, 163, 43, 147, 68, 18, 20, 0, 0, 0, 0, 0, 0, 21, 3]
  sequence_number: 1829
request: [{a: 2, b: 3}]
response: []
---
info:
  event_type: 2
  stamp:
    sec: 1726873574
    nanosec: 967806970
  client_gid: [1, 15, 163, 43, 147, 68, 18, 20, 0, 0, 0, 0, 0, 0, 21, 3]
  sequence_number: 1829
request: []
response: [{sum: 5}]
---
info:
  event_type: 3
  stamp:
    sec: 1726873574
    nanosec: 968045402
  client_gid: [1, 15, 163, 43, 147, 68, 18, 20, 0, 0, 0, 0, 0, 0, 21, 3]
  sequence_number: 1829
request: []
response: [{sum: 5}]

@fujitatomoya
Copy link
Collaborator Author

Pulls: #779
Gist: https://gist.githubusercontent.com/fujitatomoya/24d1b9af9d8b36fe3501d79b78658833/raw/e9b7750a54ef63afe0206b53106c12aaec6ecc73/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_fastrtps_shared_cpp
TEST args: --packages-above rmw_fastrtps_shared_cpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14587

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Copy link
Collaborator

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

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

Nice catch!
LGTM

@ahcorde
Copy link
Contributor

ahcorde commented Sep 23, 2024

Pulls: #779
Gist: https://gist.githubusercontent.com/ahcorde/8df2c5e69dda0758460e6f1e7d63527c/raw/e9b7750a54ef63afe0206b53106c12aaec6ecc73/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_fastrtps_shared_cpp --packages-above-and-dependencies rmw_fastrtps_shared_cpp
TEST args: --packages-above rmw_fastrtps_shared_cpp --packages-above rmw_fastrtps_shared_cpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14594

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde ahcorde merged commit 565bbc2 into rolling Sep 23, 2024
3 checks passed
@ahcorde ahcorde deleted the fujitatomoya/bugfix-service-introspection-client-gid branch September 23, 2024 17:07
Blast545 added a commit that referenced this pull request Sep 27, 2024
clalancette pushed a commit that referenced this pull request Oct 1, 2024
@fujitatomoya
Copy link
Collaborator Author

@MiguelCompany so this did not work, actually it generated the instability for CI. (not often happen, but reproducible with CI)

i am not 100 sure but i believe that the following behavior change can be a reason for this CI hang-up problem.

if ((related_guid.entityId.value[3] & entity_id_is_reader_bit) != 0) {
// Related guid is a reader, so it is the response subscription guid.
// Wait for the response writer to be matched with it.
auto listener = info->pub_listener_;
auto writer_max_blocking_time =
info->response_writer_->get_qos().reliability().max_blocking_time;
auto max_blocking_time =
std::chrono::seconds(writer_max_blocking_time.seconds) +
std::chrono::nanoseconds(writer_max_blocking_time.nanosec);
client_present_t ret = listener->check_for_subscription(related_guid, max_blocking_time);
if (ret == client_present_t::GONE) {
return RMW_RET_OK;
} else if (ret == client_present_t::MAYBE) {
RMW_SET_ERROR_MSG("client will not receive response");
return RMW_RET_TIMEOUT;
}
}

that said, we cannot keep the request publisher gid in rmw_request_id_t * request_header.
i do not have good idea to keep (or get?) the request publisher gid during the process of receiving request and sending response, unless adding the field in rmw_request_id_t. any thoughts?

@MiguelCompany
Copy link
Collaborator

@fujitatomoya I think we could use in the client the same trick we use in the server, make the request id use the GUID of the response reader, instead of the request writer

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