Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
vitstn committed Dec 4, 2024
1 parent ef06d28 commit c077826
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 2 additions & 10 deletions ydb/library/yql/providers/dq/common/yql_dq_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,8 @@ TDqConfiguration::TDqConfiguration() {
REGISTER_SETTING(*this, EnableInsert);

REGISTER_SETTING(*this, _LiteralTimeout);
REGISTER_SETTING(*this, _TableTimeout)
.ValueSetter([this](const TString&, ui64 value) {
_TableTimeout = value;
QueryTimeout = Min(QueryTimeout.Get().GetOrElse(TDefault::TableTimeout), value);
});

REGISTER_SETTING(*this, QueryTimeout)
.ValueSetter([this](const TString&, ui64 value) {
QueryTimeout = Min(value, _TableTimeout.Get().GetOrElse(TDefault::TableTimeout));
});
REGISTER_SETTING(*this, _TableTimeout);
REGISTER_SETTING(*this, QueryTimeout);

REGISTER_SETTING(*this, _LongWorkersAllocationWarnTimeout);
REGISTER_SETTING(*this, _LongWorkersAllocationFailTimeout);
Expand Down
7 changes: 6 additions & 1 deletion ydb/library/yql/providers/dq/common/yql_dq_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ struct TDqSettings {
}

ui64 GetQueryTimeout() const {
return QueryTimeout.Get().GetOrElse(_TableTimeout.Get().GetOrElse(TDefault::TableTimeout));
auto upper = _TableTimeout.Get().GetOrElse(TDefault::TableTimeout);
if (QueryTimeout.Get().Defined()) {
return Min(*QueryTimeout.Get(), upper);
}

return upper;
}

bool IsSpillingEngineEnabled() const {
Expand Down

0 comments on commit c077826

Please sign in to comment.