mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #67177 from ClickHouse/vdimir/connection_reset_by_peer_spam_log
Do not spam logs with messages related to connection reset by peer
This commit is contained in:
commit
63d7697115
@ -2,6 +2,7 @@
|
||||
#include <Server/TCPServer.h>
|
||||
|
||||
#include <Poco/Net/NetException.h>
|
||||
#include <Common/logger_useful.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -97,6 +98,21 @@ void HTTPServerConnection::run()
|
||||
{
|
||||
sendErrorResponse(session, Poco::Net::HTTPResponse::HTTP_BAD_REQUEST);
|
||||
}
|
||||
catch (const Poco::Net::NetException & e)
|
||||
{
|
||||
/// Do not spam logs with messages related to connection reset by peer.
|
||||
if (e.code() == POCO_ENOTCONN)
|
||||
{
|
||||
LOG_DEBUG(LogFrequencyLimiter(getLogger("HTTPServerConnection"), 10), "Connection reset by peer while processing HTTP request: {}", e.message());
|
||||
break;
|
||||
}
|
||||
|
||||
if (session.networkException())
|
||||
session.networkException()->rethrow();
|
||||
else
|
||||
throw;
|
||||
}
|
||||
|
||||
catch (const Poco::Exception &)
|
||||
{
|
||||
if (session.networkException())
|
||||
|
Loading…
Reference in New Issue
Block a user