aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.com>2024-08-11 10:31:25 +0300
committerbabenko <babenko@yandex-team.com>2024-08-11 10:50:18 +0300
commitccd1e498e726a5d05b17b7c451d63da5c9d845ef (patch)
treee9a0992ff399a2d780934b38f9c2e2ad703f675a /library/cpp
parent5f79e5d28fea8ef4af5756b30787e29dba8e9333 (diff)
downloadydb-ccd1e498e726a5d05b17b7c451d63da5c9d845ef.tar.gz
Throw on error in TNotificationHandle::TNotificationHandle instead of crashing
4356fc70f6d9ceec9f94b1879f49e27f3fee4342
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/yt/threading/notification_handle.cpp6
-rw-r--r--library/cpp/yt/threading/ya.make1
2 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/yt/threading/notification_handle.cpp b/library/cpp/yt/threading/notification_handle.cpp
index 0896d8169b..fea720670e 100644
--- a/library/cpp/yt/threading/notification_handle.cpp
+++ b/library/cpp/yt/threading/notification_handle.cpp
@@ -1,5 +1,7 @@
#include "notification_handle.h"
+#include <library/cpp/yt/exception/exception.h>
+
#include <library/cpp/yt/system/handle_eintr.h>
#include <library/cpp/yt/assert/assert.h>
@@ -29,7 +31,9 @@ TNotificationHandle::TNotificationHandle(bool blocking)
eventfd,
0,
EFD_CLOEXEC | (blocking ? 0 : EFD_NONBLOCK));
- YT_VERIFY(EventFD_ >= 0);
+ if (EventFD_ < 0) {
+ throw TSimpleException("Error creating notification handle");
+ }
#elif defined(_win_)
TPipeHandle::Pipe(Reader_, Writer_, EOpenModeFlag::CloseOnExec);
if (!blocking) {
diff --git a/library/cpp/yt/threading/ya.make b/library/cpp/yt/threading/ya.make
index 3b2cb13d4f..cc11e7974e 100644
--- a/library/cpp/yt/threading/ya.make
+++ b/library/cpp/yt/threading/ya.make
@@ -23,6 +23,7 @@ SRCS(
PEERDIR(
library/cpp/yt/assert
library/cpp/yt/cpu_clock
+ library/cpp/yt/exception
library/cpp/yt/system
library/cpp/yt/memory
)