]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: make 'watch' command unwatch when done 3663/head
authorSage Weil <sage@redhat.com>
Mon, 9 Feb 2015 06:05:07 +0000 (22:05 -0800)
committerSage Weil <sage@redhat.com>
Mon, 9 Feb 2015 06:05:07 +0000 (22:05 -0800)
Avoid leaving a registered watch that the OSD has to time out.  If you
want to do that, you can hit ^C.

Signed-off-by: Sage Weil <sage@redhat.com>
src/tools/rados/rados.cc

index 9797a8e4fe391663960e55362d86bbb074d6eae1..b6b0d9a90ff41c289e619688aad13f6e24654b28 100644 (file)
@@ -2281,6 +2281,8 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     else {
       cout << "press enter to exit..." << std::endl;
       getchar();
+      io_ctx.unwatch2(cookie);
+      rados.watch_flush();
     }
   }
   else if (strcmp(nargs[0], "notify") == 0) {