Skip to content

Commit

Permalink
common: by default, do not assert on leaks in the shared_cache code
Browse files Browse the repository at this point in the history
Update the standard qa suite cluster configs so that we continue
asserting in our nightlies, but users don't hit this.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
gregsfortytwo committed Oct 9, 2017
1 parent d28506d commit feb7763
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 4 deletions.
4 changes: 3 additions & 1 deletion qa/clusters/extra-client.yaml
Expand Up @@ -11,4 +11,6 @@ overrides:
ceph:
conf:
osd:
osd shutdown pgref assert: true
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
2 changes: 2 additions & 0 deletions qa/clusters/fixed-1.yaml
Expand Up @@ -10,5 +10,7 @@ overrides:
conf:
osd:
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
roles:
- [mon.a, mgr.x, osd.0, osd.1, osd.2, client.0]
2 changes: 2 additions & 0 deletions qa/clusters/fixed-2.yaml
Expand Up @@ -10,3 +10,5 @@ overrides:
conf:
osd:
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
4 changes: 3 additions & 1 deletion qa/clusters/fixed-3-cephfs.yaml
Expand Up @@ -13,4 +13,6 @@ overrides:
ceph:
conf:
osd:
osd shutdown pgref assert: true
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
2 changes: 2 additions & 0 deletions qa/clusters/fixed-3.yaml
Expand Up @@ -11,3 +11,5 @@ overrides:
conf:
osd:
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
4 changes: 3 additions & 1 deletion qa/clusters/fixed-4.yaml
Expand Up @@ -7,4 +7,6 @@ overrides:
ceph:
conf:
osd:
osd shutdown pgref assert: true
osd shutdown pgref assert: true
global:
debug_asserts_on_shutdown: true
4 changes: 4 additions & 0 deletions src/common/options.cc
Expand Up @@ -4222,6 +4222,10 @@ std::vector<Option> get_global_options() {
Option("debug_deliberately_leak_memory", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description(""),

Option("debug_asserts_on_shutdown", Option::TYPE_BOOL,Option::LEVEL_DEV)
.set_default(false)
.set_description("Enable certain asserts to check for refcounting bugs on shutdown; see http://tracker.ceph.com/issues/21738"),
});
}

Expand Down
4 changes: 3 additions & 1 deletion src/common/shared_cache.hpp
Expand Up @@ -105,7 +105,9 @@ class SharedLRU {
lderr(cct) << "leaked refs:\n";
dump_weak_refs(*_dout);
*_dout << dendl;
assert(weak_refs.empty());
if (cct->_conf->get_val<bool>("debug_asserts_on_shutdown")) {
assert(weak_refs.empty());
}
}
}

Expand Down

0 comments on commit feb7763

Please sign in to comment.