]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
exporter: avoid stoi for empty pid_str 48206/head
authorAvan Thakkar <athakkar@redhat.com>
Tue, 20 Sep 2022 20:30:31 +0000 (02:00 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Thu, 22 Sep 2022 12:26:55 +0000 (17:56 +0530)
Fixes: https://tracker.ceph.com/issues/57619
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit cff3cf1d31342be759cdd848cd074a247b56b238)

src/exporter/DaemonMetricCollector.cc

index 7f88113b9905690e6abc426041b64fef70654190..6eb11b1225cff661d60e454c0c1dfb23050591ed 100644 (file)
@@ -114,7 +114,9 @@ void DaemonMetricCollector::dump_asok_metrics() {
     if (!pid_path.size()) {
       continue;
     }
-    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) {