Open amfern opened 2 years ago
Hi @amfern , thanks for your contribution and sorry for the late reponse. Could you check if this issue is happening in current Fast DDS v2.11.0, or in 2.6.x with ROS2 Humble?
hi @JesusPoderoso, Thank you for taking look at this issue.
I was able to reproduce it with ros2 humble.
Dockerfile:
# docker build -t amfernus/reproduce-wait-for-service-hang:latest .
# docker run -ti --rm amfernus/reproduce-wait-for-service-hang:latest
FROM ros:humble
RUN apt update \
&& apt install -y ros-$ROS_DISTRO-demo-nodes-cpp ros-$ROS_DISTRO-rmw-fastrtps-cpp
COPY reproduce-wait-for-service-hang.sh /reproduce-wait-for-service-hang.sh
RUN chmod +x /reproduce-wait-for-service-hang.sh
ENV HOME=/tmp
RUN mkdir -p /tmp/.ros/log
CMD ["/reproduce-wait-for-service-hang.sh"]
reproduce-wait-for-service-hang.sh
#!/bin/bash
/opt/ros/$ROS_DISTRO/bin/fast-discovery-server -i 0 & PID_SERVER1=$!
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
exit 0
}
sleep 1
while true; do
echo "starting add_two_ints_server"
ROS_DISCOVERY_SERVER="127.0.0.1:11811" RMW_IMPLEMENTATION=rmw_fastrtps_cpp bash -c /opt/ros/$ROS_DISTRO/lib/demo_nodes_cpp/add_two_ints_server & PID1=$!
echo "making requests with add_two_ints_client"
ROS_DISCOVERY_SERVER="127.0.0.1:11811" RMW_IMPLEMENTATION=rmw_fastrtps_cpp bash -c /opt/ros/$ROS_DISTRO/lib/demo_nodes_cpp/add_two_ints_client
echo "killing with add_two_ints_server"
kill $PID1
done
Log file:
### Server is running ###
Participant Type: SERVER
Server ID: 0
Server GUID prefix: 44.53.00.5f.45.50.52.4f.53.49.4d.41
Server Addresses: UDPv4:[0.0.0.0]:11811
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061016.364759091] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061016.365062414] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061016.472848887] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061017.394033975] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061017.394417655] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061017.501218417] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061018.425045462] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061018.425391449] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061018.536351660] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061019.536751341] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061019.538609977] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061019.648116027] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061020.567411455] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061020.567829574] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061020.676770604] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061021.606870243] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061021.607161045] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061021.714935911] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061022.636857995] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061022.637167072] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061022.744428405] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061023.665421602] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061023.665716798] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061023.773531640] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061024.693272589] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061024.693765435] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061024.810887465] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061025.731512608] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061025.731767331] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061025.838791569] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061026.765234505] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061026.765638715] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061026.878195631] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061027.798767857] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061027.799141610] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061027.908918190] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061028.830995246] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061028.834461001] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061028.950569846] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061029.871018098] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061029.871346727] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061029.981285251] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061030.901433125] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061030.901775290] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061031.009967442] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061031.945786905] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061031.946104867] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061032.070693962] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061033.018068023] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061033.018417456] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061033.133278936] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061034.086880989] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061034.087161467] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061034.201379869] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061035.135242126] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061035.135704924] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061035.243078805] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061036.178724362] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061036.179138020] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061036.290174978] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061037.326947759] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061037.327388348] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061037.440694251] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061038.363939027] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061038.364448454] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061038.480079597] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061039.437182454] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061039.437680346] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061039.563487157] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061040.519828453] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061040.520259349] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061040.635032014] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061041.656359834] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061041.656751764] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061041.765239096] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061042.722131180] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061042.722775011] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061042.841188851] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061043.774807092] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061043.775433280] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061043.887458213] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061044.845045448] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061044.845345296] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061044.953342155] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061045.914580864] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061045.914894990] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061046.023427672] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061046.958340776] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061046.960193827] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061047.082170108] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061048.020292296] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061048.020620285] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061048.137916562] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061049.084251240] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061049.084591445] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061049.192506116] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061050.132967053] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061050.133473584] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061050.241824849] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061051.200039131] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061051.200435615] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061051.309755265] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061052.342867863] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061052.343431915] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061052.453311693] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061053.386017661] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061053.386408692] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061053.495256415] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061054.437583329] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061054.441060656] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061054.550931778] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061055.494413039] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061055.494720323] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061055.603102678] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061056.534863673] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061056.535257947] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061056.652378294] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061057.584178243] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061057.584565103] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061057.694007613] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061058.644508539] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061058.644970881] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061058.766155678] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061059.698606875] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061059.698959896] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061059.813203908] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061060.753000406] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061060.753351258] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061060.860195325] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061061.790636508] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061061.790969094] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061061.898088109] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061062.844667554] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061062.845000240] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061062.952407663] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061063.909649886] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061063.910003415] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061064.027816412] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061064.954491182] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061064.954959874] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061065.064779463] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061065.997623203] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061065.998051463] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061066.108827210] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061067.061629330] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061067.062254396] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061067.170700903] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061068.115365531] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061068.116168019] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061068.229092082] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061069.163419184] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061069.163774172] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061069.271981134] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061070.198939744] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061070.199269440] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061070.309019417] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061071.352180951] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061071.352522262] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061071.463468412] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061072.475182150] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061072.477472106] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061072.588058749] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061073.605185118] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061073.605575937] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061073.719833930] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061074.735146467] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061074.741379127] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061074.854597201] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061075.782123195] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061075.782467950] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061075.903418612] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061076.828955115] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061076.829280463] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061076.937168199] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061077.858719373] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061077.859792626] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061077.971186417] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061078.904053020] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061078.904588521] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061079.014488175] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061079.950482128] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061079.950836445] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061080.059331257] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061080.982060679] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061080.982335970] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061081.089405618] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061082.009653988] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061082.010044757] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061082.116845987] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061083.038894005] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061083.039223170] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061083.147011407] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061084.079956568] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061084.080272221] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061084.187663215] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061085.109552722] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061085.109891653] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061085.216958028] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061086.150316425] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061086.150653948] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061086.259267015] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061087.179976746] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061087.180294864] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061087.288034330] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061088.220845973] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061088.221304874] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061088.329403565] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061089.260298645] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061089.260599433] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061089.368453950] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061090.291002372] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061090.291510203] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061090.400080550] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061091.322639750] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061091.323047442] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061091.430986395] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061092.354951299] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061092.355445438] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061092.467835767] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061093.388855218] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061093.389195320] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061093.498033055] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061094.423551422] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061094.423967253] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061094.531831312] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061095.462151523] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061095.462492169] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061095.570566950] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061096.502858660] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061096.503198613] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061096.611208800] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061097.542090644] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061097.542464412] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061097.649613506] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061098.580991601] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061098.581616553] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061098.691317219] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061099.614354622] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061099.614724217] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061099.722763977] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061100.647722629] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061100.648036435] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061100.756533751] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061101.681088277] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061101.685311575] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061101.796735353] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061102.737843576] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061102.738438045] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061102.846009150] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061103.770635883] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061103.771213282] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061103.892291361] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061104.814566384] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061104.814921851] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061104.923597251] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061105.846945056] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061105.847340718] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061105.955843608] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061106.882706438] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061106.883238446] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061106.995021328] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061107.918628612] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061107.918972570] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061108.027455169] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061108.957363689] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061108.958053848] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061109.066909992] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061109.988423558] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061109.988718230] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061110.096557658] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061111.018717957] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061111.019025510] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061111.126983889] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061112.048136378] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061112.048455845] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061112.158408470] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061113.080182451] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061113.080528735] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061113.187752259] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061114.111805750] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061114.112089215] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061114.220301396] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061115.154066025] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061115.154541988] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061115.262305272] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061116.183747155] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061116.184192102] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061116.292221488] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061117.213921173] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061117.214240367] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061117.321962689] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061118.247701316] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061118.248137966] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061118.357653294] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061119.361721400] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061119.362487635] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061119.480113991] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061120.406765718] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061120.407436209] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061120.519405822] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061121.443743083] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061121.444038902] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061121.555206800] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061122.491497577] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061122.491936928] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061122.604904031] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061123.529055043] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061123.529410835] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061123.639410180] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061124.562875346] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061124.563223914] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061124.672965049] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061125.604900696] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061125.605476382] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061125.713644983] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061126.646118820] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061126.646469370] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061126.759845337] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061127.681554231] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061127.681870382] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061127.789746161] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061128.717746186] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061128.718121790] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061128.828441349] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061129.760514920] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061129.760898196] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061129.876218528] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061130.836496653] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061130.837390484] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061130.961210168] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061131.901043307] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061131.901500012] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061132.020185735] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061132.963518748] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061132.963881119] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061133.077040530] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061134.039648357] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061134.039944681] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061134.148138474] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061135.092220863] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061135.092538301] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061135.200635514] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061136.132281084] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061136.132569966] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
making requests with add_two_ints_client
[INFO] [1689061136.240825994] [rclcpp]: signal_handler(signum=15)
[INFO] [1689061137.197847717] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061137.198143098] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061137.305262841] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061138.258318384] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061138.258919533] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061138.369911314] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061139.332263169] [add_two_ints_server]: Incoming request
a: 2 b: 3
[INFO] [1689061139.332658698] [add_two_ints_client]: Result of add_two_ints: 5
killing with add_two_ints_server
starting add_two_ints_server
[INFO] [1689061139.442159882] [rclcpp]: signal_handler(signum=15)
making requests with add_two_ints_client
[INFO] [1689061140.487387948] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061141.487686923] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061142.487887133] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061143.488074607] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061144.488277853] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061145.488464470] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061146.488661821] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061147.488866895] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061148.489070847] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061149.489263103] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061150.489461510] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061151.489989270] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061152.490157135] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061153.490327775] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061154.490505499] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061155.490686839] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061156.490952980] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061157.491126731] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061158.491299093] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061159.491471889] [add_two_ints_client]: service not available, waiting again...
[INFO] [1689061160.491644826] [add_two_ints_client]: service not available, waiting again...
Hi @amfern, thanks for the reproducer. I was able to reproduce the issue, and i also tested the scenario with simple discovery, using unicast, multicast and initial peers, and it worked as expected. That means for me that the issue is discovery server related. This issue is now categorized as bug, and we will look for solving this.
I reproduced this issue too with discovery server
ros2 service list
returns nothing
Expected Behavior
wait_for_service block until the service is discovered
Current Behavior
When service and client are created in the same time, the wait_for_service will hang indefinably. This doesn't happen when using multicast. Even as one of the nodes hangs on wait_for_service, I can run the same client and get a response
Steps to Reproduce
The service and client must be started at the same time for the issue to appear, we use the systemd to run ros2 nodes on nvidia jetson inside a
ros:galactic
container, so this bug occures pretty frequently on our system.I attached a script
reproduce-wait-for-service-hang.sh
that pretty easily reproduces the bug, a YouTube video and a docker imageThis docker image will reproduce the bug
docker run -ti --rm amfernus/reproduce-wait-for-service-hang:latest
System information
arch linux host Linux ilya.linux 5.15.0-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 04 Nov 2021 00:40:01 +0000 x86_64 GNU/Linux
Additional resources
/opt/ros/galactic/bin/fast-discovery-server -i 0 & PID_SERVER1=$!
trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() { exit 0 }
sleep 1
while true; do echo "starting add_two_ints_server" ROS_DISCOVERY_SERVER="127.0.0.1:11811" RMW_IMPLEMENTATION=rmw_fastrtps_cpp bash -c /opt/ros/galactic/lib/demo_nodes_cpp/add_two_ints_server & PID1=$! echo "making requests with add_two_ints_client" ROS_DISCOVERY_SERVER="127.0.0.1:11811" RMW_IMPLEMENTATION=rmw_fastrtps_cpp bash -c /opt/ros/galactic/lib/demo_nodes_cpp/add_two_ints_client echo "killing with add_two_ints_server" kill $PID1 done