Skip to content

Commit

Permalink
catch exception of LocalAdmissionController::stop() (#8942) (#9062)
Browse files Browse the repository at this point in the history
close #8860
  • Loading branch information
ti-chi-bot authored May 20, 2024
1 parent 79f5b12 commit f032a2e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dbms/src/Flash/ResourceControl/LocalAdmissionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,19 @@ class LocalAdmissionController final : private boost::noncopyable
background_threads.emplace_back([this] { this->watchGAC(); });
}

~LocalAdmissionController() { stop(); }
~LocalAdmissionController() { safeStop(); }

void safeStop()
{
try
{
stop();
}
catch (...)
{
LOG_ERROR(log, "stop server id({}) failed: {}", unique_client_id, getCurrentExceptionMessage(false));
}
}

void consumeCPUResource(const std::string & name, double ru, uint64_t cpu_time_in_ns)
{
Expand Down

0 comments on commit f032a2e

Please sign in to comment.