Skip to contentSkip to conversation

client: Fix for client hang caused by connection drop to MDS.

PATCH New [email protected] 1 participant 1 message Nov 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 client: Fix for client hang caused by connection drop to MDS.

From: Sam Lang <[email protected]>

This patch will cause inprogress client operations to the MDS server to be kicked if the connection to the MDS server is dropped.

---
 src/client/Client.cc |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
src/client/Client.cc +12 -0
index 78d12c8e..1f37dfc 100644
@@ -6907,6 +6907,18 @@ bool Client::ms_handle_reset(Connection *con)
   ldout(cct, 0) << "ms_handle_reset on " << con->get_peer_addr() << dendl;
   Mutex::Locker l(client_lock);
   objecter->ms_handle_reset(con);
+
+  // look for mds that has this connection and kick associated requests
+  for(map<int, MetaSession*>::iterator it = mds_sessions.begin();
+      it != mds_sessions.end();
+      it++)
+  {
+      if((*it).second->inst.addr.probably_equals(con->get_peer_addr()))
+      {
+          kick_requests((*it).first, true);
+          break;
+      }
+  }
   return false;
 }
 
Signature · 1 line
1.7.5.4