fix: separate Heartbeat and ShardHandler to fibers (#3936)

* separate shard_handler from Heartbeat
* add test

---------

Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
Kostas Kyrimis 2024-10-29 09:22:53 +02:00 committed by GitHub
parent f16a32582e
commit 4b495182e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 135 additions and 44 deletions

View file

@ -121,7 +121,8 @@ void EngineShardSet::Init(uint32_t sz, std::function<void()> shard_handler) {
// Must be last, as it accesses objects initialized above.
// We can not move shard_handler because this code is called multiple times.
shard->StartPeriodicFiber(pb, shard_handler);
shard->StartPeriodicHeartbeatFiber(pb);
shard->StartPeriodicShardHandlerFiber(pb, shard_handler);
}
});
}