From d8ecfe93d0abb77c51296334e74fab67f7407792 Mon Sep 17 00:00:00 2001 From: Yadu Date: Thu, 21 Mar 2024 23:24:16 +0800 Subject: [PATCH] Set timeout_ms to max value (#133) Signed-off-by: Yadunund --- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index 99301136..99ce9eae 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -2234,6 +2234,11 @@ rmw_send_request( opts.attachment = z_bytes_map_as_attachment(&map); opts.target = Z_QUERY_TARGET_ALL_COMPLETE; + // The default timeout for a z_get query is 10 seconds and if a response is not received within + // this window, the queryable will return an invalid reply. However, it is common for actions, + // which are implemented using services, to take an extended duration to complete.Hence, we set + // the timeout_ms to the largest supported value to account for most realistic scenarios. + opts.timeout_ms = std::numeric_limits::max(); // Latest consolidation guarantees unicity of replies for the same key expression, // which optimizes bandwidth. The default is "None", which imples replies may come in any order // and any number.