chore: stop periodic task earlier during the shutdown process (#4187)

Fixes #4151

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-11-26 10:02:15 +02:00 committed by GitHub
parent e7b49fa1c4
commit 1709061ae6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -403,11 +403,10 @@ void EngineShard::Shutdown() {
queue2_.Shutdown();
DCHECK(!fiber_heartbeat_periodic_.IsJoinable());
DCHECK(!fiber_shard_handler_periodic_.IsJoinable());
ProactorBase::me()->RemoveOnIdleTask(defrag_task_);
}
void EngineShard::StopPeriodicFiber() {
ProactorBase::me()->RemoveOnIdleTask(defrag_task_);
fiber_heartbeat_periodic_done_.Notify();
if (fiber_heartbeat_periodic_.IsJoinable()) {
fiber_heartbeat_periodic_.Join();

View file

@ -969,7 +969,8 @@ void SerializerBase::DumpObject(const CompactObj& obj, io::StringSink* out) {
// 1. Save the value itself - without the key
// 2. Save footer: this include the RDB version and the CRC value for the message
auto type = RdbObjectType(obj);
DVLOG(1) << "We are going to dump object type: " << int(type);
DVLOG(2) << "We are going to dump object type: " << int(type);
std::error_code ec = serializer.WriteOpcode(type);
CHECK(!ec);
ec = serializer.SaveValue(obj);