Skip to content

Commit

Permalink
Debug: Update watchdog multikill to log number of threads stuck. (env…
Browse files Browse the repository at this point in the history
…oyproxy#29653)

Update watchdog multikill to log number of threads stuck.

Signed-off-by: Kevin Baichoo <[email protected]>
  • Loading branch information
KBaichoo authored Sep 15, 2023
1 parent 0295b58 commit 04cd72e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/server/guarddog_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ void GuardDogImpl::step() {
multi_kill_threads.emplace_back(tid, last_checkin);

if (multi_kill_threads.size() >= required_for_multi_kill) {
ENVOY_LOG_MISC(error, "Watchdog MULTIKILL as {} threads are stuck.",
multi_kill_threads.size());
invokeGuardDogActions(WatchDogAction::MULTIKILL, multi_kill_threads, now);
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/server/guarddog_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ TEST_P(GuardDogDeathTest, MultiKillDeathTest) {
time_system_->advanceTimeWait(std::chrono::milliseconds(2)); // 1 ms past multi-death.
guard_dog_->forceCheckForTest();
};
EXPECT_DEATH(die_function(), "");
EXPECT_DEATH(die_function(), "Watchdog MULTIKILL as 2 threads are stuck");
}

TEST_P(GuardDogAlmostDeadTest, MultiKillNoFinalCheckTest) {
Expand Down

0 comments on commit 04cd72e

Please sign in to comment.