summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/threading/notification_handle.cpp
diff options
context:
space:
mode:
authorbabenko <[email protected]>2024-08-11 10:31:25 +0300
committerbabenko <[email protected]>2024-08-11 10:50:18 +0300
commitccd1e498e726a5d05b17b7c451d63da5c9d845ef (patch)
treee9a0992ff399a2d780934b38f9c2e2ad703f675a /library/cpp/yt/threading/notification_handle.cpp
parent5f79e5d28fea8ef4af5756b30787e29dba8e9333 (diff)
Throw on error in TNotificationHandle::TNotificationHandle instead of crashing
4356fc70f6d9ceec9f94b1879f49e27f3fee4342
Diffstat (limited to 'library/cpp/yt/threading/notification_handle.cpp')
-rw-r--r--library/cpp/yt/threading/notification_handle.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/cpp/yt/threading/notification_handle.cpp b/library/cpp/yt/threading/notification_handle.cpp
index 0896d8169b3..fea720670ed 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) {