Update AsynchronousMetrics.cpp

This commit is contained in:
Alexey Milovidov 2023-04-21 13:51:13 +03:00 committed by GitHub
parent 11b3469eac
commit a6fceaa497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -683,6 +683,11 @@ void AsynchronousMetrics::update(TimePoint update_time)
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
/// A slight improvement for the rare case when ClickHouse is run inside LXC and LXCFS is used.
/// The LXCFS has an issue: sometimes it returns an error "Transport endpoint is not connected" on reading from the file inside `/proc`.
/// This error was correctly logged into ClickHouse's server log, but it was a source of annoyance to some users.
/// We additionally workaround this issue by reopening a file.
openFileIfExists("/proc/loadavg", loadavg);
}
}