mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[#3112] catch all exception when running IOService run, run_one and poll
This commit is contained in:
@@ -164,7 +164,12 @@ IoServiceThreadPool::setState(State state) {
|
||||
case State::PAUSED: {
|
||||
// Stop IOService.
|
||||
if (!io_service_->stopped()) {
|
||||
io_service_->poll();
|
||||
try {
|
||||
io_service_->poll();
|
||||
} catch (...) {
|
||||
// Catch all exceptions.
|
||||
// Logging is not available.
|
||||
}
|
||||
io_service_->stop();
|
||||
}
|
||||
|
||||
@@ -180,7 +185,12 @@ IoServiceThreadPool::setState(State state) {
|
||||
case State::STOPPED: {
|
||||
// Stop IOService.
|
||||
if (!io_service_->stopped()) {
|
||||
io_service_->poll();
|
||||
try {
|
||||
io_service_->poll();
|
||||
} catch (...) {
|
||||
// Catch all exceptions.
|
||||
// Logging is not available.
|
||||
}
|
||||
io_service_->stop();
|
||||
}
|
||||
|
||||
@@ -215,8 +225,13 @@ IoServiceThreadPool::threadWork() {
|
||||
}
|
||||
}
|
||||
|
||||
// Run the IOService.
|
||||
io_service_->run();
|
||||
try {
|
||||
// Run the IOService.
|
||||
io_service_->run();
|
||||
} catch (...) {
|
||||
// Catch all exceptions.
|
||||
// Logging is not available.
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_lock<std::mutex> lck(mutex_);
|
||||
|
@@ -837,7 +837,13 @@ DControllerBase::~DControllerBase() {
|
||||
}
|
||||
|
||||
io_signal_set_.reset();
|
||||
getIOService()->poll();
|
||||
try {
|
||||
getIOService()->poll();
|
||||
} catch (...) {
|
||||
// Don't want to throw exceptions from the destructor. The process
|
||||
// is shutting down anyway.
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
|
Reference in New Issue
Block a user