aboutsummaryrefslogtreecommitdiffstats
path: root/yql
diff options
context:
space:
mode:
authormrlolthe1st <mrlolthe1st@yandex-team.com>2025-02-18 21:54:44 +0300
committermrlolthe1st <mrlolthe1st@yandex-team.com>2025-02-18 22:22:22 +0300
commitafe5f174d1537a99ec81b46bd61861bc7f1a29ee (patch)
tree0fb8d1b8fa85ea4e5e0f10ac20fb9e23cf833603 /yql
parentf29f61716d400e5eeb90d62ae9fc5ec0b7d3a39f (diff)
downloadydb-afe5f174d1537a99ec81b46bd61861bc7f1a29ee.tar.gz
YQL-19537: QPlayer test
commit_hash:bcd3e54f9aef46d22d4547aecf501bb839b57e9d
Diffstat (limited to 'yql')
-rw-r--r--yql/essentials/core/qplayer/storage/interface/yql_qstorage.cpp27
-rw-r--r--yql/essentials/core/type_ann/type_ann_core.cpp4
2 files changed, 28 insertions, 3 deletions
diff --git a/yql/essentials/core/qplayer/storage/interface/yql_qstorage.cpp b/yql/essentials/core/qplayer/storage/interface/yql_qstorage.cpp
index 603c30809c..12be993325 100644
--- a/yql/essentials/core/qplayer/storage/interface/yql_qstorage.cpp
+++ b/yql/essentials/core/qplayer/storage/interface/yql_qstorage.cpp
@@ -1,5 +1,7 @@
#include "yql_qstorage.h"
+#include <util/system/mutex.h>
+
namespace NYql {
class TQWriterDecorator : public IQWriter {
public:
@@ -8,14 +10,31 @@ class TQWriterDecorator : public IQWriter {
if (Closed_) {
return NThreading::MakeFuture();
}
- return Underlying_->Put(key, value);
+ try {
+ return Underlying_->Put(key, value);
+ } catch (...) {
+ auto message = CurrentExceptionMessage();
+ with_lock(Mutex_) {
+ Exception_ = std::move(message);
+ }
+ Close();
+ return NThreading::MakeFuture();
+ }
}
NThreading::TFuture<void> Commit() override final {
- if (Closed_) {
+ with_lock(Mutex_) {
+ if (Exception_) {
+ throw yexception() << "QWriter exception while Put(): " << *Exception_ << ")";
+ }
+ }
+ bool expected = false;
+ if (!Closed_.compare_exchange_strong(expected, true)) {
throw yexception() << "QWriter closed";
}
- return Underlying_->Commit();
+ auto result = Underlying_->Commit();
+ Underlying_ = {};
+ return result;
}
// Close all used files, doesn't commit anything
@@ -26,8 +45,10 @@ class TQWriterDecorator : public IQWriter {
}
}
private:
+ TMaybe<TString> Exception_;
IQWriterPtr Underlying_;
std::atomic<bool> Closed_ = false;
+ TMutex Mutex_;
};
IQWriterPtr MakeCloseAwareWriterDecorator(IQWriterPtr&& rhs) {
diff --git a/yql/essentials/core/type_ann/type_ann_core.cpp b/yql/essentials/core/type_ann/type_ann_core.cpp
index 732edecc45..fdf64d5d9e 100644
--- a/yql/essentials/core/type_ann/type_ann_core.cpp
+++ b/yql/essentials/core/type_ann/type_ann_core.cpp
@@ -37,6 +37,7 @@
#include <util/string/cast.h>
#include <util/string/join.h>
#include <util/string/split.h>
+#include <util/system/env.h>
#include <algorithm>
#include <functional>
@@ -589,12 +590,15 @@ namespace NTypeAnnImpl {
}
auto failureKind = input->Child(0)->Content();
+ Y_ABORT_UNLESS(!TryGetEnv("YQL_DETERMINISTIC_MODE") || failureKind != "crash");
if (failureKind == "expr") {
input->SetTypeAnn(ctx.Expr.MakeType<TDataExprType>(NUdf::EDataSlot::String));
} else if (failureKind == "type") {
input->SetTypeAnn(ctx.Expr.MakeType<TDataExprType>(NUdf::EDataSlot::String));
} else if (failureKind == "constraint") {
input->SetTypeAnn(ctx.Expr.MakeType<TListExprType>(ctx.Expr.MakeType<TDataExprType>(NUdf::EDataSlot::String)));
+ } else if (failureKind == "exception") {
+ ythrow yexception() << "FailMe exception";
} else {
ctx.Expr.AddError(TIssue(ctx.Expr.GetPosition(input->Child(0)->Pos()), TStringBuilder() << "Unknown failure kind: " << failureKind));
return IGraphTransformer::TStatus::Error;