mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
test: Handle destructor of KvStoreBench by adding io_ctx_ready bool
Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
parent
21a0eb3618
commit
3de15e8bb8
@ -37,7 +37,8 @@ KvStoreBench::KvStoreBench()
|
||||
ops_in_flight(0),
|
||||
ops_in_flight_lock("KvStoreBench::ops_in_flight_lock"),
|
||||
rados_id("admin"),
|
||||
pool_name("rbd")
|
||||
pool_name("rbd"),
|
||||
io_ctx_ready(false)
|
||||
{
|
||||
probs[25] = 'i';
|
||||
probs[50] = 'u';
|
||||
@ -47,9 +48,11 @@ KvStoreBench::KvStoreBench()
|
||||
|
||||
KvStoreBench::~KvStoreBench()
|
||||
{
|
||||
librados::ObjectWriteOperation owo;
|
||||
owo.remove();
|
||||
io_ctx.operate(client_name + ".done-setting", &owo);
|
||||
if (io_ctx_ready) {
|
||||
librados::ObjectWriteOperation owo;
|
||||
owo.remove();
|
||||
io_ctx.operate(client_name + ".done-setting", &owo);
|
||||
}
|
||||
delete kvs;
|
||||
}
|
||||
|
||||
@ -187,6 +190,7 @@ int KvStoreBench::setup(int argc, const char** argv) {
|
||||
rados.shutdown();
|
||||
return r;
|
||||
}
|
||||
io_ctx_ready = true;
|
||||
|
||||
if (clear_first) {
|
||||
librados::ObjectIterator it;
|
||||
|
@ -125,6 +125,7 @@ protected:
|
||||
librados::Rados rados;
|
||||
string rados_id;
|
||||
string pool_name;
|
||||
bool io_ctx_ready;
|
||||
librados::IoCtx io_ctx;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user