mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Merge pull request #33639 from Algunenano/async_metrics_handle_failures
AsynchronousMetrics: Ignore inaccessible sensors
This commit is contained in:
commit
35c03b317e
@ -109,6 +109,23 @@ void AsynchronousMetrics::openSensors()
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
file->rewind();
|
||||
Int64 temperature = 0;
|
||||
try
|
||||
{
|
||||
readText(temperature, *file);
|
||||
}
|
||||
catch (const ErrnoException & e)
|
||||
{
|
||||
LOG_WARNING(
|
||||
&Poco::Logger::get("AsynchronousMetrics"),
|
||||
"Thermal monitor '{}' exists but could not be read, error {}.",
|
||||
thermal_device_index,
|
||||
e.getErrno());
|
||||
continue;
|
||||
}
|
||||
|
||||
thermal.emplace_back(std::move(file));
|
||||
}
|
||||
}
|
||||
@ -222,6 +239,23 @@ void AsynchronousMetrics::openSensorsChips()
|
||||
std::replace(sensor_name.begin(), sensor_name.end(), ' ', '_');
|
||||
}
|
||||
|
||||
file->rewind();
|
||||
Int64 temperature = 0;
|
||||
try
|
||||
{
|
||||
readText(temperature, *file);
|
||||
}
|
||||
catch (const ErrnoException & e)
|
||||
{
|
||||
LOG_WARNING(
|
||||
&Poco::Logger::get("AsynchronousMetrics"),
|
||||
"Hardware monitor '{}', sensor '{}' exists but could not be read, error {}.",
|
||||
hwmon_name,
|
||||
sensor_name,
|
||||
e.getErrno());
|
||||
continue;
|
||||
}
|
||||
|
||||
hwmon_devices[hwmon_name][sensor_name] = std::move(file);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user