Libtransport: Debug lost PING to backend
This commit is contained in:
parent
8a903b9bfb
commit
899d6fe53f
2 changed files with 8 additions and 0 deletions
|
@ -1305,6 +1305,7 @@ void NetworkPluginServer::send(boost::shared_ptr<Swift::Connection> &c, const st
|
|||
}
|
||||
|
||||
void NetworkPluginServer::pingTimeout() {
|
||||
LOG4CXX_INFO(logger, "Sending PING to backends");
|
||||
// TODO: move to separate timer, those 2 loops could be expensive
|
||||
// Some users are connected for weeks and they are blocking backend to be destroyed and its memory
|
||||
// to be freed. We are finding users who are inactive for more than "idle_reconnect_time" seconds and
|
||||
|
@ -1350,6 +1351,9 @@ void NetworkPluginServer::pingTimeout() {
|
|||
if ((*it)->pongReceived) {
|
||||
sendPing((*it));
|
||||
}
|
||||
else {
|
||||
LOG4CXX_INFO(logger, "Tried to send PING to backend without pongReceived= " << (*it)->pongReceived << ": (ID=" << (*it)->id << ")");
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG4CXX_INFO(logger, "Disconnecting backend " << (*it) << " (ID=" << (*it)->id << "). PING response not received.");
|
||||
|
@ -1966,6 +1970,9 @@ void NetworkPluginServer::sendPing(Backend *c) {
|
|||
send(c->connection, message);
|
||||
c->pongReceived = false;
|
||||
}
|
||||
else {
|
||||
LOG4CXX_WARN(logger, "Tried to send PING to backend without connection: " << c << " (ID=" << c->id << ")");
|
||||
}
|
||||
// LOG4CXX_INFO(logger, "PING to " << c);
|
||||
}
|
||||
|
||||
|
|
|
@ -676,6 +676,7 @@ void NetworkPlugin::send(const std::string &data) {
|
|||
|
||||
void NetworkPlugin::checkPing() {
|
||||
if (m_pingReceived == false) {
|
||||
LOG4CXX_ERROR(logger, "PING request not received - exiting...");
|
||||
handleExitRequest();
|
||||
}
|
||||
m_pingReceived = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue