From a6fceaa497bfd8dfcdf53a6dbafc001375f6eeba Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 21 Apr 2023 13:51:13 +0300 Subject: [PATCH] Update AsynchronousMetrics.cpp --- src/Common/AsynchronousMetrics.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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); } }