Add comment

This commit is contained in:
Antonio Andelic 2023-11-28 15:32:20 +01:00 committed by GitHub
parent 1242834256
commit d10aeef23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -329,6 +329,10 @@ void KeeperServer::launchRaftServer(const Poco::Util::AbstractConfiguration & co
params.return_method_ = nuraft::raft_params::async_handler;
nuraft::asio_service::options asio_opts{};
/// If asio worker threads fail in any way, NuRaft will stop to make any progress
/// For that reason we need to supress out of memory exceptions in such threads
/// TODO: use `get_active_workers` to detect when we have no active workers to abort
asio_opts.worker_start_ = [](uint32_t /*worker_id*/)
{
LockMemoryExceptionInThread::addUniqueLock(VariableContext::Global);