Commit f72422cc authored by Scott Michelson's avatar Scott Michelson Committed by Facebook Github Bot

LOG_EVERY_N instead of every time

Summary: when queues fill, this starts blowing up, affecting server performance and making logs useless. It's useful to know queues are full, but we don't need the log every time we try to append

Reviewed By: yfeldblum

Differential Revision: D6175784

fbshipit-source-id: b4e6966087c4a6f9fba51d7f9193b9f41e13b899
parent d89c342a
...@@ -962,7 +962,7 @@ void AsyncServerSocket::dispatchSocket(int socket, ...@@ -962,7 +962,7 @@ void AsyncServerSocket::dispatchSocket(int socket,
// should use pauseAccepting() to temporarily back off accepting new // should use pauseAccepting() to temporarily back off accepting new
// connections, before they reach the point where their threads can't // connections, before they reach the point where their threads can't
// even accept new messages. // even accept new messages.
LOG(ERROR) << "failed to dispatch newly accepted socket:" LOG_EVERY_N(ERROR, 100) << "failed to dispatch newly accepted socket:"
<< " all accept callback queues are full"; << " all accept callback queues are full";
closeNoInt(socket); closeNoInt(socket);
if (connectionEventCallback_) { if (connectionEventCallback_) {
...@@ -1002,9 +1002,10 @@ void AsyncServerSocket::dispatchError(const char *msgstr, int errnoValue) { ...@@ -1002,9 +1002,10 @@ void AsyncServerSocket::dispatchError(const char *msgstr, int errnoValue) {
if (callbackIndex_ == startingIndex) { if (callbackIndex_ == startingIndex) {
// The notification queues for all of the callbacks were full. // The notification queues for all of the callbacks were full.
// We can't really do anything at this point. // We can't really do anything at this point.
LOG(ERROR) << "failed to dispatch accept error: all accept callback " LOG_EVERY_N(ERROR, 100)
"queues are full: error msg: " << << "failed to dispatch accept error: all accept"
msg.msg.c_str() << errnoValue; << " callback queues are full: error msg: " << msg.msg << ": "
<< errnoValue;
return; return;
} }
info = nextCallback(); info = nextCallback();
......
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