Changeset - 899d6fe53fdb
[Not reviewed]
0 2 0
Jan Kaluza - 9 years ago 2016-02-11 14:42:17
jkaluza@redhat.com
Libtransport: Debug lost PING to backend
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
libtransport/NetworkPluginServer.cpp
Show inline comments
 
@@ -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);
 
}
 

	
plugin/cpp/networkplugin.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)