This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit ccc4bc312aec137bcabfdc0708edab60a078927f Author: Damian Meden <[email protected]> AuthorDate: Wed Mar 26 11:01:03 2025 +0100 traffic_top - Fix uncought exception (#12100) * Fix for CID-1512719 (cherry picked from commit 6d57b9629f80caed9490ce28b6c0d702e8a19b41) --- src/traffic_top/stats.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/traffic_top/stats.h b/src/traffic_top/stats.h index 89a5ffc808..cfed64fbb4 100644 --- a/src/traffic_top/stats.h +++ b/src/traffic_top/stats.h @@ -276,8 +276,15 @@ public: const LookupItem &item = lookup_it->second; if (item.type == 1 || item.type == 2 || item.type == 5 || item.type == 8) { - // Add records names to the rpc request. - request.emplace_rec(detail::MetricParam{item.name}); + try { + // Add records names to the rpc request. + request.emplace_rec(detail::MetricParam{item.name}); + } catch (std::exception const &e) { + // Hard break, something happened when trying to set the last metric name into the request. + // This is very unlikely but just in case, we stop it. + fprintf(stderr, "Error configuring the stats request, local error: %s", e.what()); + return false; + } } } // query the rpc node.
