This is an automated email from the ASF dual-hosted git repository.

dmeden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d57b9629f traffic_top - Fix uncought exception (#12100)
6d57b9629f is described below

commit 6d57b9629f80caed9490ce28b6c0d702e8a19b41
Author: Damian Meden <[email protected]>
AuthorDate: Wed Mar 26 11:01:03 2025 +0100

    traffic_top - Fix uncought exception (#12100)
    
    * 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 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.

Reply via email to