]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: dispose of connections after handle_command
authorJohn Spray <john.spray@redhat.com>
Thu, 4 Aug 2016 14:04:17 +0000 (15:04 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 29 Sep 2016 16:27:04 +0000 (17:27 +0100)
...to avoid leaking them and eventually running out of fds.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/DaemonServer.cc

index cddbf0a69fb40e7b9731b5bc21b29eb0f94957f5..8ba6f904665c36632eee9770e2d066466ec11cfd 100644 (file)
@@ -305,6 +305,12 @@ bool DaemonServer::handle_command(MCommand *m)
   }
 
  out:
+
+  // Let the connection drop as soon as we've sent our response
+  if (m->get_connection()) {
+    m->get_connection()->mark_disposable();
+  }
+
   std::string rs;
   rs = ss.str();
   odata.append(ds);