Require a message on "Application::signalStop" (#5255)

This change adds a message parameter to Application::signalStop for extra context.
This commit is contained in:
Ed Hennis
2025-06-20 12:24:34 -04:00
committed by tequ
parent 051da27285
commit 36b8cd42e1
4 changed files with 7 additions and 7 deletions

View File

@@ -96,7 +96,7 @@ Env::AppBundle::~AppBundle()
if (app)
{
app->getJobQueue().rendezvous();
app->signalStop();
app->signalStop("~AppBundle");
}
if (thread.joinable())
thread.join();

View File

@@ -288,7 +288,7 @@ public:
config_->CONFIG_DIR),
*this,
logs_->journal("PerfLog"),
[this] { signalStop(); }))
[this] { signalStop("PerfLog"); }))
, m_txMaster(*this)
@@ -508,7 +508,7 @@ public:
void
run() override;
void
signalStop(std::string msg = "") override;
signalStop(std::string msg) override;
bool
checkSigs() const override;
void
@@ -980,7 +980,7 @@ public:
if (!config_->standalone() &&
!getRelationalDatabase().transactionDbHasSpace(*config_))
{
signalStop();
signalStop("Out of transaction DB space");
}
// VFALCO NOTE Does the order of calls matter?
@@ -1200,7 +1200,7 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline)
JLOG(m_journal.info()) << "Received signal " << signum;
if (signum == SIGTERM || signum == SIGINT)
signalStop();
signalStop("Signal: " + to_string(signum));
});
auto debug_log = config_->getDebugLogFile();

View File

@@ -140,7 +140,7 @@ public:
virtual void
run() = 0;
virtual void
signalStop(std::string msg = "") = 0;
signalStop(std::string msg) = 0;
virtual bool
checkSigs() const = 0;
virtual void

View File

@@ -31,7 +31,7 @@ struct JsonContext;
Json::Value
doStop(RPC::JsonContext& context)
{
context.app.signalStop();
context.app.signalStop("RPC");
return RPC::makeObjectValue(systemName() + " server stopping");
}