mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
Merge pull request #29476 from tchaikov/wip-test/journal-close-object
test/journal: always close object Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
commit
815f52831f
@ -66,10 +66,14 @@ public:
|
|||||||
static_cast<uint64_t>(max_in_flight)}
|
static_cast<uint64_t>(max_in_flight)}
|
||||||
{}
|
{}
|
||||||
~ObjectRecorderFlusher() {
|
~ObjectRecorderFlusher() {
|
||||||
for (auto& object_recorder : m_object_recorders) {
|
for (auto& [object_recorder, m] : m_object_recorders) {
|
||||||
C_SaferCond cond;
|
C_SaferCond cond;
|
||||||
object_recorder->flush(&cond);
|
object_recorder->flush(&cond);
|
||||||
cond.wait();
|
cond.wait();
|
||||||
|
std::scoped_lock l{*m};
|
||||||
|
if (!object_recorder->is_closed()) {
|
||||||
|
object_recorder->close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
journal::ObjectRecorderPtr create_object(const std::string& oid,
|
journal::ObjectRecorderPtr create_object(const std::string& oid,
|
||||||
@ -84,7 +88,7 @@ public:
|
|||||||
m_flush_bytes,
|
m_flush_bytes,
|
||||||
m_flush_age);
|
m_flush_age);
|
||||||
}
|
}
|
||||||
m_object_recorders.push_back(object);
|
m_object_recorders.emplace_back(object, lock);
|
||||||
m_handler.object_lock = lock;
|
m_handler.object_lock = lock;
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
@ -110,7 +114,8 @@ public:
|
|||||||
uint64_t m_flush_bytes = std::numeric_limits<uint64_t>::max();
|
uint64_t m_flush_bytes = std::numeric_limits<uint64_t>::max();
|
||||||
double m_flush_age = 600;
|
double m_flush_age = 600;
|
||||||
uint64_t m_max_in_flight_appends = 0;
|
uint64_t m_max_in_flight_appends = 0;
|
||||||
using ObjectRecorders = std::list<journal::ObjectRecorderPtr>;
|
using ObjectRecorders =
|
||||||
|
std::list<std::pair<journal::ObjectRecorderPtr, ceph::mutex*>>;
|
||||||
ObjectRecorders m_object_recorders;
|
ObjectRecorders m_object_recorders;
|
||||||
Handler m_handler;
|
Handler m_handler;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user