mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
feat(server): add prints on takeover timeout (#2856)
feat server: add prints on takeover timeout Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
a5ea47f2d9
commit
700fae6a58
2 changed files with 13 additions and 3 deletions
|
@ -302,6 +302,9 @@ class Connection : public util::Connection {
|
|||
// Stops traffic logging in this thread. A noop if the thread is not logging.
|
||||
static void StopTrafficLogging();
|
||||
|
||||
// Get quick debug info for logs
|
||||
std::string DebugInfo() const;
|
||||
|
||||
protected:
|
||||
void OnShutdown() override;
|
||||
void OnPreMigrateThread() override;
|
||||
|
@ -381,9 +384,6 @@ class Connection : public util::Connection {
|
|||
// Clear pipelined messages, disaptching only intrusive ones.
|
||||
void ClearPipelinedMessages();
|
||||
|
||||
// Get quick debug info for logs
|
||||
std::string DebugInfo() const;
|
||||
|
||||
std::pair<std::string, std::string> GetClientInfoBeforeAfterTid() const;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -370,7 +370,17 @@ void DflyCmd::TakeOver(CmdArgList args, ConnectionContext* cntx) {
|
|||
if (!tracker.Wait(timeout_dur)) {
|
||||
LOG(WARNING) << "Couldn't wait for commands to finish dispatching. " << timeout_dur;
|
||||
status = OpStatus::TIMED_OUT;
|
||||
|
||||
auto cb = [&](unsigned thread_index, util::Connection* conn) {
|
||||
facade::Connection* dcon = static_cast<facade::Connection*>(conn);
|
||||
LOG(INFO) << dcon->DebugInfo();
|
||||
};
|
||||
|
||||
for (auto* listener : sf_->GetListeners()) {
|
||||
listener->TraverseConnections(cb);
|
||||
}
|
||||
}
|
||||
|
||||
VLOG(1) << "AwaitCurrentDispatches done";
|
||||
|
||||
// We have this guard to disable expirations: We don't want any writes to the journal after
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue