Commit 66e9e82c authored by Thomas Markwalder's avatar Thomas Markwalder
Browse files

[3407] Added more thorough work around for #3470 issue

Move signal hanlding initialization til after the
initial configuration but before calling runProcess().
Added additional call to clear the SignalSet inside
catch() block for runProcess.
parent fcf1eb40
...@@ -76,8 +76,6 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) { ...@@ -76,8 +76,6 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
"Application Process initialization failed: " << ex.what()); "Application Process initialization failed: " << ex.what());
} }
// Now that we have a proces, we can set up signal handling.
initSignalHandling();
LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_STANDALONE).arg(app_name_); LOG_DEBUG(dctl_logger, DBGLVL_START_SHUT, DCTL_STANDALONE).arg(app_name_);
...@@ -95,20 +93,28 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) { ...@@ -95,20 +93,28 @@ DControllerBase::launch(int argc, char* argv[], const bool test_mode) {
// Everything is clear for launch, so start the application's // Everything is clear for launch, so start the application's
// event loop. // event loop.
try { try {
// Now that we have a proces, we can set up signal handling.
initSignalHandling();
runProcess(); runProcess();
/// @todo Once Trac #3470 is addressed this will not be necessary.
/// SignalSet uses statics which do not free in predicatable order.
if (signal_set_) {
signal_set_->clear();
}
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
LOG_FATAL(dctl_logger, DCTL_PROCESS_FAILED) LOG_FATAL(dctl_logger, DCTL_PROCESS_FAILED)
.arg(app_name_).arg(ex.what()); .arg(app_name_).arg(ex.what());
/// @todo Once Trac #3470 is addressed this will not be necessary.
/// SignalSet uses statics which do not free in predicatable order.
if (signal_set_) {
signal_set_->clear();
}
isc_throw (ProcessRunError, isc_throw (ProcessRunError,
"Application process event loop failed: " << ex.what()); "Application process event loop failed: " << ex.what());
} }
/// @todo Once Trac #3470 is addressed this will not be necessary.
/// SignalSet uses statics which do not free in predicatable order.
if (signal_set_) {
signal_set_->clear();
}
// All done, so bail out. // All done, so bail out.
LOG_INFO(dctl_logger, DCTL_STOPPING).arg(app_name_); LOG_INFO(dctl_logger, DCTL_STOPPING).arg(app_name_);
} }
......
...@@ -106,8 +106,8 @@ public: ...@@ -106,8 +106,8 @@ public:
/// ///
/// 1. parse command line arguments /// 1. parse command line arguments
/// 2. instantiate and initialize the application process /// 2. instantiate and initialize the application process
/// 3. initialize signal handling /// 3. load the configuration file
/// 4. load the configuration file /// 4. initialize signal handling
/// 5. start and wait on the application process event loop /// 5. start and wait on the application process event loop
/// 6. exit to the caller /// 6. exit to the caller
/// ///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment