https://rethinkdb.com/blog/handling-stack-overflow-on-custom-stacks/

https://barrgroup.com/embedded-systems/how-to/prevent-detect-stack-overflow 

etc.
{
        current_connections = 0;
        for (auto & server : servers)
        {
            server.stop();
            current_connections += server.currentConnections();
        }
        if (!current_connections)
            break;
        sleep_current_ms += sleep_one_ms;
        std::this_thread::sleep_for(std::chrono::milliseconds(sleep_one_ms));
    }
    return current_connections;
}
}
namespace DB
{
namespace ErrorCodes
{
    extern const int NO_ELEMENTS_IN_CONFIG;
    extern const int SUPPORT_IS_DISABLED;
    extern const int ARGUMENT_OUT_OF_BOUND;
    extern const int EXCESSIVE_ELEMENT_IN_CONFIG;
    extern const int INVALID_CONFIG_PARAMETER;
    extern const int SYSTEM_ERROR;
    extern const int FAILED_TO_GETPWUID;
    extern const int MISMATCHING_USERS_FOR_PROCESS_AND_DATA;
    extern const int NETWORK_ERROR;
}
static std::string getCanonicalPath(std::string && path)