New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librados: only call watch_flush if necessary #3243
Conversation
@@ -283,7 +283,8 @@ int librados::RadosClient::connect() | |||
void librados::RadosClient::shutdown() | |||
{ | |||
// make sure watch callbacks are flushed | |||
watch_flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to move it down to the if (need_objecter) ?
Fix bug ceph#10424 Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
$ libtool --mode=execute valgrind --tool=memcheck ./unittest_librados ==31815== Memcheck, a memory error detector ==31815== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==31815== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info ==31815== Command: /home/loic/software/ceph/ceph/src/.libs/lt-unittest_librados ==31815== Running main() from gtest_main.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from Librados [ RUN ] Librados.CreateShutdown [ OK ] Librados.CreateShutdown (336 ms) [----------] 1 test from Librados (348 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (386 ms total) [ PASSED ] 1 test. ==31815== ==31815== HEAP SUMMARY: ==31815== in use at exit: 0 bytes in 0 blocks ==31815== total heap usage: 731 allocs, 731 frees, 92,086 bytes allocated ==31815== ==31815== All heap blocks were freed -- no leaks are possible ==31815== ==31815== For counts of detected and suppressed errors, rerun with: -v ==31815== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
$ libtool --mode=execute valgrind --tool=memcheck ./unittest_librados_config ==31962== Memcheck, a memory error detector ==31962== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==31962== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info ==31962== Command: /home/loic/software/ceph/ceph/src/.libs/lt-unittest_librados_config ==31962== Running main() from gtest_main.cc [==========] Running 3 tests from 1 test case. [----------] Global test environment set-up. [----------] 3 tests from LibRadosConfig [ RUN ] LibRadosConfig.SimpleSet [ OK ] LibRadosConfig.SimpleSet (359 ms) [ RUN ] LibRadosConfig.ArgV [ OK ] LibRadosConfig.ArgV (44 ms) [ RUN ] LibRadosConfig.DebugLevels [ OK ] LibRadosConfig.DebugLevels (30 ms) [----------] 3 tests from LibRadosConfig (444 ms total) [----------] Global test environment tear-down [==========] 3 tests from 1 test case ran. (484 ms total) [ PASSED ] 3 tests. ==31962== ==31962== HEAP SUMMARY: ==31962== in use at exit: 0 bytes in 0 blocks ==31962== total heap usage: 2,010 allocs, 2,010 frees, 173,345 bytes allocated ==31962== ==31962== All heap blocks were freed -- no leaks are possible ==31962== ==31962== For counts of detected and suppressed errors, rerun with: -v ==31962== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) |
SUCCESS: the output of run-make-check.sh on 8869099 is http://paste.ubuntu.com/9602864/ |
SUCCESS: the output of run-make-check.sh on 7978b26 is http://paste.ubuntu.com/9602922/ |
Valgrind clean as above with the updated modification. |
librados: only call watch_flush if necessary Reviewed-by: Loic Dachary <ldachary@redhat.com>
Fix bug #10424
Signed-off-by: Haomai Wang haomaiwang@gmail.com