Skip to content

Commit

Permalink
Require a message on "Application::signalStop"
Browse files Browse the repository at this point in the history
  • Loading branch information
ximinez committed Feb 7, 2025
1 parent 02387fd commit 72fadc5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/test/jtx/impl/Env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Env::AppBundle::~AppBundle()
if (app)
{
app->getJobQueue().rendezvous();
app->signalStop();
app->signalStop("~AppBundle");
}
if (thread.joinable())
thread.join();
Expand Down
8 changes: 4 additions & 4 deletions src/xrpld/app/main/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class ApplicationImp : public Application, public BasicApp
config_->CONFIG_DIR),
*this,
logs_->journal("PerfLog"),
[this] { signalStop(); }))
[this] { signalStop("PerfLog"); }))

, m_txMaster(*this)

Expand Down Expand Up @@ -507,7 +507,7 @@ class ApplicationImp : public Application, public BasicApp
void
run() override;
void
signalStop(std::string msg = "") override;
signalStop(std::string msg) override;
bool
checkSigs() const override;
void
Expand Down Expand Up @@ -979,7 +979,7 @@ class ApplicationImp : public Application, public BasicApp
if (!config_->standalone() &&
!getRelationalDatabase().transactionDbHasSpace(*config_))
{
signalStop();
signalStop("Out of transaction DB space");
}

// VFALCO NOTE Does the order of calls matter?
Expand Down Expand Up @@ -1195,7 +1195,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();
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/app/main/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Application : public beast::PropertyStream::Source
virtual void
run() = 0;
virtual void
signalStop(std::string msg = "") = 0;
signalStop(std::string msg) = 0;
virtual bool
checkSigs() const = 0;
virtual void
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/rpc/handlers/Stop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct JsonContext;
Json::Value
doStop(RPC::JsonContext& context)
{
context.app.signalStop();
context.app.signalStop("RPC");
return RPC::makeObjectValue(systemName() + " server stopping");
}

Expand Down

0 comments on commit 72fadc5

Please sign in to comment.