Commit ba3cfbb0 authored by Giuseppe Ottaviano's avatar Giuseppe Ottaviano Committed by Facebook GitHub Bot

Throttle accept error logs

Summary:
Currently the log is printed on every `accept()` failure, and those are likely to be correlated (most commonly, while the service is crashing), causing log spew at a time when high log signal-to-noise is crucial.

Throttle it and a couple of other related logs.

Reviewed By: yfeldblum

Differential Revision: D28777847

fbshipit-source-id: b4d1898b41f722362b7cdda53597bb37f5fdfa83
parent 525c2f4f
......@@ -26,6 +26,7 @@
#include <cstring>
#include <folly/FileUtil.h>
#include <folly/GLog.h>
#include <folly/Portability.h>
#include <folly/SocketAddress.h>
#include <folly/String.h>
......@@ -1085,8 +1086,9 @@ void AsyncServerSocket::dispatchSocket(
// should use pauseAccepting() to temporarily back off accepting new
// connections, before they reach the point where their threads can't
// even accept new messages.
LOG_EVERY_N(ERROR, 100) << "failed to dispatch newly accepted socket:"
<< " all accept callback queues are full";
FB_LOG_EVERY_MS(ERROR, 1000)
<< "failed to dispatch newly accepted socket:"
<< " all accept callback queues are full";
closeNoInt(socket);
if (connectionEventCallback_) {
connectionEventCallback_->onConnectionDropped(socket, addr);
......@@ -1123,7 +1125,7 @@ void AsyncServerSocket::dispatchError(const char* msgstr, int errnoValue) {
if (callbackIndex_ == startingIndex) {
// The notification queues for all of the callbacks were full.
// We can't really do anything at this point.
LOG_EVERY_N(ERROR, 100)
FB_LOG_EVERY_MS(ERROR, 1000)
<< "failed to dispatch accept error: all accept"
<< " callback queues are full: error msg: " << msg.msg << ": "
<< errnoValue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment