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

[test_rclcpp] #101 test_services_cpp (test_rclcpp.TestTwoExecutables.test_services_cpp) #152

Closed
Tracked by #147
Yadunund opened this issue Apr 5, 2024 · 4 comments · Fixed by #153 or #159
Closed
Tracked by #147
Assignees
Labels
bug Something isn't working

Comments

@Yadunund
Copy link
Member

Yadunund commented Apr 5, 2024

Failure

[test_services_client_cpp-2] [==========] Running 5 tests from 1 test suite.
[test_services_client_cpp-2] [----------] Global test environment set-up.
[test_services_client_cpp-2] [----------] 5 tests from test_services_client
[test_services_client_cpp-2] [INFO] [1712303353.082268953] [rmw_zenoh_cpp]: Successfully connected to a Zenoh router with id 3e37a66397bacb45b5938f4ad4063a8.
[test_services_server_cpp-1] [INFO] [1712303353.086031453] [rmw_zenoh_cpp]: Successfully connected to a Zenoh router with id 3e37a66397bacb45b5938f4ad4063a8.
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_noreqid
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_noreqid (109 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_reqid
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_reqid (2 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_return_request
[test_services_client_cpp-2] [       OK ] test_services_client.test_return_request (5 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_two_ints_defered_cb
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_two_ints_defered_cb (2 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_two_ints_defcb_with_handle
[test_services_server_cpp-1]   what():  failed to send response: Unable to find taken request. Report this bug., at /home/yadunund/ros2_rolling/src/rmw_alternative/rmw_zenoh_cpp/src/rmw_zenoh.cpp:2890, at /home/yadunund/ros2_rolling/src/ros2/rcl/rcl/src/rcl/service.c:400
@Yadunund Yadunund added the bug Something isn't working label Apr 5, 2024
@Yadunund Yadunund changed the title [test_rclcpp] test_services_cpp (test_rclcpp.TestTwoExecutables.test_services_cpp) [test_rclcpp-101] test_services_cpp (test_rclcpp.TestTwoExecutables.test_services_cpp) Apr 5, 2024
@Yadunund Yadunund changed the title [test_rclcpp-101] test_services_cpp (test_rclcpp.TestTwoExecutables.test_services_cpp) [test_rclcpp] #101 test_services_cpp (test_rclcpp.TestTwoExecutables.test_services_cpp) Apr 5, 2024
@Yadunund
Copy link
Member Author

Yadunund commented Apr 5, 2024

With some debug statements it looks like the the sequence_number generated for each client is always 1 (See lines "Generated sequence_id 1 for client ..." below). Therefore the service cannot find the same sequence_number after it returns a response for the first client.

[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_noreqid
[test_services_client_cpp-2] Generated sequence_id 1 for client over /add_two_ints_noreqid
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_noreqid (109 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_reqid
[test_services_client_cpp-2] Generated sequence_id 1 for client over /add_two_ints_reqid
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_reqid (2 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_return_request
[test_services_client_cpp-2] Generated sequence_id 1 for client over /add_two_ints_reqid_return_request
[test_services_client_cpp-2] [       OK ] test_services_client.test_return_request (2 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_two_ints_defered_cb
[test_services_client_cpp-2] Generated sequence_id 1 for client over /add_two_ints_defered_cb
[test_services_client_cpp-2] [       OK ] test_services_client.test_add_two_ints_defered_cb (3 ms)
[test_services_client_cpp-2] [ RUN      ] test_services_client.test_add_two_ints_defcb_with_handle
[test_services_server_cpp-1] terminate called after throwing an instance of 'rclcpp::exceptions::RCLError'
[test_services_server_cpp-1]   what():  failed to send response: Unable to find taken request for sequence_number 1. Report this bug., at /home/yadunund/ros2_rolling/src/rmw_alternative/rmw_zenoh_cpp/src/rmw_zenoh.cpp:2897, at /home/yadunund/ros2_rolling/src/ros2/rcl/rcl/src/rcl/service.c:400

@Yadunund
Copy link
Member Author

Yadunund commented Apr 5, 2024

Okay so this is caused by the sequence_to_query_map_ data structure used to map sequence_number of client request and the ZenohQuery, ie this map.
We're not distinguishing between which client the query came from.

Two solutions come to mind:

  1. Make sequence_number generated by the client globally unique.
  2. Update sequence_to_query_map_ such that it maps std::unordered_map<gid, std::unordered_map<sequence_number, ZenohQuery>>

@clalancette what do you think? Personally I think we 2 is easier.

@Yadunund Yadunund self-assigned this Apr 5, 2024
@clalancette
Copy link
Collaborator

clalancette commented Apr 5, 2024

We're not distinguishing between which client the query came from.

Ah, of course.

2. Update sequence_to_query_map_ such that it maps std::unordered_map<gid, std::unordered_map<sequence_number, ZenohQuery>>

Just to be clear; the gid as the key here would be the gid that the client attaches, correct? If so, then yes, I think this is the way to go; it uses information we already have.

@Yadunund
Copy link
Member Author

Yadunund commented Apr 5, 2024

Yupp the gid the client already attaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants