diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc index 82230b04d1d..d5d22eb4bec 100644 --- a/proxy/logging/LogObject.cc +++ b/proxy/logging/LogObject.cc @@ -39,6 +39,7 @@ #include #include +#include static bool should_roll_on_time(Log::RollingEnabledValues roll) @@ -382,7 +383,9 @@ LogObject::_checkout_write(size_t *write_offset, size_t bytes_needed) break; case LogBuffer::LB_RETRY: - // no more room, but another thread should be taking care of creating a new buffer, so try again + // no more room, but another thread should be taking care of creating a new buffer, so yield to let + // the other thread finish, then try again + std::this_thread::yield(); break; case LogBuffer::LB_BUFFER_TOO_SMALL: