diff --git a/src/Common/AsynchronousMetrics.cpp b/src/Common/AsynchronousMetrics.cpp index 06fb005c314..63315ebc0dd 100644 --- a/src/Common/AsynchronousMetrics.cpp +++ b/src/Common/AsynchronousMetrics.cpp @@ -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); } }