mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 22:15:23 +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: {
|
case State::PAUSED: {
|
||||||
// Stop IOService.
|
// Stop IOService.
|
||||||
if (!io_service_->stopped()) {
|
if (!io_service_->stopped()) {
|
||||||
|
try {
|
||||||
io_service_->poll();
|
io_service_->poll();
|
||||||
|
} catch (...) {
|
||||||
|
// Catch all exceptions.
|
||||||
|
// Logging is not available.
|
||||||
|
}
|
||||||
io_service_->stop();
|
io_service_->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +185,12 @@ IoServiceThreadPool::setState(State state) {
|
|||||||
case State::STOPPED: {
|
case State::STOPPED: {
|
||||||
// Stop IOService.
|
// Stop IOService.
|
||||||
if (!io_service_->stopped()) {
|
if (!io_service_->stopped()) {
|
||||||
|
try {
|
||||||
io_service_->poll();
|
io_service_->poll();
|
||||||
|
} catch (...) {
|
||||||
|
// Catch all exceptions.
|
||||||
|
// Logging is not available.
|
||||||
|
}
|
||||||
io_service_->stop();
|
io_service_->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,8 +225,13 @@ IoServiceThreadPool::threadWork() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Run the IOService.
|
// Run the IOService.
|
||||||
io_service_->run();
|
io_service_->run();
|
||||||
|
} catch (...) {
|
||||||
|
// Catch all exceptions.
|
||||||
|
// Logging is not available.
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lck(mutex_);
|
std::unique_lock<std::mutex> lck(mutex_);
|
||||||
|
@@ -837,7 +837,13 @@ DControllerBase::~DControllerBase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
io_signal_set_.reset();
|
io_signal_set_.reset();
|
||||||
|
try {
|
||||||
getIOService()->poll();
|
getIOService()->poll();
|
||||||
|
} catch (...) {
|
||||||
|
// Don't want to throw exceptions from the destructor. The process
|
||||||
|
// is shutting down anyway.
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
Reference in New Issue
Block a user