From 2eb20dff28836b1b13f438f4fb202c4069090018 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 1 Mar 2025 13:29:38 +0300 Subject: [PATCH] Do not crash on io_uring initialization failure in node-vitastor --- node-binding/client.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/node-binding/client.cc b/node-binding/client.cc index 68f01c0c..3e6cd156 100644 --- a/node-binding/client.cc +++ b/node-binding/client.cc @@ -81,6 +81,12 @@ NAN_METHOD(NodeVitastor::Create) NodeVitastor* cli = new NodeVitastor(); cli->c = vitastor_c_create_uring_json(c_cfg, cfg.size()); delete[] c_cfg; + if (!cli->c) + { + ERRORF("NodeVitastor: failed to initialize io_uring (old kernel or insufficient ulimit -l?)"); + Nan::ThrowError("failed to initialize io_uring (old kernel or insufficient ulimit -l?)"); + return; + } int res = vitastor_c_uring_register_eventfd(cli->c); if (res >= 0)