From 8ca8c7511caa6137e947b8123e7854300d8b7e0d Mon Sep 17 00:00:00 2001 From: Damian Meden Date: Fri, 14 Mar 2025 15:06:38 +0000 Subject: [PATCH 1/2] Fix for CID-1512719 --- 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 89a5ffc8086..27438c7530b 100644 --- a/src/traffic_top/stats.h +++ b/src/traffic_top/stats.h @@ -276,8 +276,15 @@ class Stats 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 unlikly 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. From 11b53c02dc8210f64e5067c30e1e395a81023f84 Mon Sep 17 00:00:00 2001 From: Damian Meden Date: Fri, 14 Mar 2025 16:13:51 +0100 Subject: [PATCH 2/2] Update stats.h - Fix typo --- src/traffic_top/stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/traffic_top/stats.h b/src/traffic_top/stats.h index 27438c7530b..cfed64fbb46 100644 --- a/src/traffic_top/stats.h +++ b/src/traffic_top/stats.h @@ -281,7 +281,7 @@ class Stats 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 unlikly but just in case, we stop it. + // 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; }