]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
exporter: avoid stoi for empty pid_str
authorAvan Thakkar <athakkar@redhat.com>
Tue, 20 Sep 2022 20:30:31 +0000 (02:00 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Wed, 21 Sep 2022 07:42:34 +0000 (13:12 +0530)
Fixes: https://tracker.ceph.com/issues/57619
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
src/exporter/DaemonMetricCollector.cc

index 8d5bad0d97b468e75937135b815a14ec8b7cdbe3..a8fef46548e92aa05bab4d0293beb3015b59fa2d 100644 (file)
@@ -129,7 +129,9 @@ void DaemonMetricCollector::dump_asok_metrics() {
       dout(1) << "pid path is empty; process metrics won't be fetched for: "
               << daemon_name << dendl;
     }
-    daemon_pids.push_back({daemon_name, std::stoi(pid_str)});
+    if (!pid_str.empty()) {
+      daemon_pids.push_back({daemon_name, std::stoi(pid_str)});
+    }
     json_object dump = boost::json::parse(perf_dump_response).as_object();
     json_object schema = boost::json::parse(perf_schema_response).as_object();
     for (auto &perf : schema) {