]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test_stress_watch: just one librados instance
authorSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 03:54:19 +0000 (20:54 -0700)
committerSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 04:27:11 +0000 (21:27 -0700)
This was creating a new cluster connection/session per iteration, and
along with it a few service threads and sockets and so forth.

Unfortunately, librados leaks like a sieve, starting with CephContext
and ceph::crypto::init().  See #845 and #2067.

Signed-off-by: Sage Weil <sage@inktank.com>
src/test/test_stress_watch.cc

index d5cfc9e21ff9bad905be0f22d8422e26799eb2a4..ec75bd91170b0fe5999a25477304b12b39f8c1b7 100644 (file)
@@ -38,10 +38,10 @@ struct WatcherUnwatcher : public Thread {
   WatcherUnwatcher(string& _pool) : pool(_pool) {}
 
   void *entry() {
+    Rados cluster;
+    connect_cluster_pp(cluster);
     while (!stop_flag.read()) {
-      Rados cluster;
       IoCtx ioctx;
-      connect_cluster_pp(cluster);
       cluster.ioctx_create(pool.c_str(), ioctx);
 
       uint64_t handle;