summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgolear <[email protected]>2024-12-25 17:05:54 +0300
committerdgolear <[email protected]>2024-12-25 17:25:30 +0300
commitf9642edbe01368fbcf1b895cdff184c42e0d98ec (patch)
tree0cfb47af865ba3959b698bfb24faab93b05e3588
parente1cd64df2f5bf9ed2148cb2cc81bb9686751f102 (diff)
YTORM-1244: Add per-request timeouts to cpp client
commit_hash:f0180827389cc7617bd00de5f6234d3c21fbee6c
-rw-r--r--yt/yt/client/api/client_common.h5
-rw-r--r--yt/yt/client/api/public.h3
-rw-r--r--yt/yt/client/api/rpc_proxy/helpers.cpp8
-rw-r--r--yt/yt/client/api/rpc_proxy/helpers.h4
-rw-r--r--yt/yt/core/actions/invoker_detail.h2
-rw-r--r--yt/yt/core/rpc/helpers.cpp9
-rw-r--r--yt/yt/core/rpc/helpers.h6
-rw-r--r--yt/yt/core/rpc/public.h7
8 files changed, 24 insertions, 20 deletions
diff --git a/yt/yt/client/api/client_common.h b/yt/yt/client/api/client_common.h
index d2b07ace80f..87f102cf820 100644
--- a/yt/yt/client/api/client_common.h
+++ b/yt/yt/client/api/client_common.h
@@ -26,11 +26,6 @@ struct TMutatingOptions
NRpc::TMutationId GetOrGenerateMutationId() const;
};
-struct TTimeoutOptions
-{
- std::optional<TDuration> Timeout;
-};
-
struct TMultiplexingBandOptions
{
NRpc::EMultiplexingBand MultiplexingBand = NRpc::EMultiplexingBand::Default;
diff --git a/yt/yt/client/api/public.h b/yt/yt/client/api/public.h
index 47eea56fb8e..0e92ead601c 100644
--- a/yt/yt/client/api/public.h
+++ b/yt/yt/client/api/public.h
@@ -121,7 +121,7 @@ using TClientOptions = NAuth::TAuthenticationOptions;
struct TTransactionParticipantOptions;
-struct TTimeoutOptions;
+using TTimeoutOptions = NRpc::TTimeoutOptions;
struct TTransactionalOptions;
struct TPrerequisiteOptions;
struct TMasterReadOptions;
@@ -241,4 +241,3 @@ using TMaintenanceCountsPerTarget = TCompactFlatMap<std::string, TMaintenanceCou
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT::NApi
-
diff --git a/yt/yt/client/api/rpc_proxy/helpers.cpp b/yt/yt/client/api/rpc_proxy/helpers.cpp
index 23be8d3baef..9c558cfdf2d 100644
--- a/yt/yt/client/api/rpc_proxy/helpers.cpp
+++ b/yt/yt/client/api/rpc_proxy/helpers.cpp
@@ -2076,14 +2076,6 @@ bool IsRetriableError(const TError& error, bool retryProxyBanned, bool retrySequ
IsDynamicTableRetriableError(error);
}
-////////////////////////////////////////////////////////////////////////////////
-
-void SetTimeoutOptions(
- NRpc::TClientRequest& request,
- const TTimeoutOptions& options)
-{
- request.SetTimeout(options.Timeout);
-}
////////////////////////////////////////////////////////////////////////////////
// ROWSETS
diff --git a/yt/yt/client/api/rpc_proxy/helpers.h b/yt/yt/client/api/rpc_proxy/helpers.h
index 8849b7be443..7d385c1d8d7 100644
--- a/yt/yt/client/api/rpc_proxy/helpers.h
+++ b/yt/yt/client/api/rpc_proxy/helpers.h
@@ -16,10 +16,6 @@ namespace NYT::NApi::NRpcProxy {
////////////////////////////////////////////////////////////////////////////////
-void SetTimeoutOptions(
- NRpc::TClientRequest& request,
- const NApi::TTimeoutOptions& options);
-
[[noreturn]] void ThrowUnimplemented(const TString& method);
////////////////////////////////////////////////////////////////////////////////
diff --git a/yt/yt/core/actions/invoker_detail.h b/yt/yt/core/actions/invoker_detail.h
index 8e79afab2b7..c031ac0dc73 100644
--- a/yt/yt/core/actions/invoker_detail.h
+++ b/yt/yt/core/actions/invoker_detail.h
@@ -55,7 +55,7 @@ class TInvokerProfileWrapper
public:
/*!
* #registry defines a profile registry where sensors data is stored.
- * #invokerFamily defines a family of invokers, e.g. "serialized" or "prioriized" and appears in sensor's name.
+ * #invokerFamily defines a family of invokers, e.g. "serialized" or "prioritized" and appears in sensor's name.
* #tagSet defines a particular instance of the invoker and appears in sensor's tags.
*/
TInvokerProfileWrapper(NProfiling::IRegistryPtr registry, const TString& invokerFamily, const NProfiling::TTagSet& tagSet);
diff --git a/yt/yt/core/rpc/helpers.cpp b/yt/yt/core/rpc/helpers.cpp
index e335ca9e1a3..772468eb2b7 100644
--- a/yt/yt/core/rpc/helpers.cpp
+++ b/yt/yt/core/rpc/helpers.cpp
@@ -33,6 +33,15 @@ using NYT::FromProto;
////////////////////////////////////////////////////////////////////////////////
+void SetTimeoutOptions(
+ NRpc::TClientRequest& request,
+ const TTimeoutOptions& options)
+{
+ request.SetTimeout(options.Timeout);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
bool IsRetriableError(const TError& error)
{
if (IsChannelFailureError(error)) {
diff --git a/yt/yt/core/rpc/helpers.h b/yt/yt/core/rpc/helpers.h
index 06240176136..e7079aacee1 100644
--- a/yt/yt/core/rpc/helpers.h
+++ b/yt/yt/core/rpc/helpers.h
@@ -23,6 +23,12 @@ namespace NYT::NRpc {
////////////////////////////////////////////////////////////////////////////////
+void SetTimeoutOptions(
+ NRpc::TClientRequest& request,
+ const TTimeoutOptions& options);
+
+////////////////////////////////////////////////////////////////////////////////
+
bool IsRetriableError(const TError& error);
bool IsChannelFailureError(const TError& error);
diff --git a/yt/yt/core/rpc/public.h b/yt/yt/core/rpc/public.h
index ea0a1475947..f3d325a3455 100644
--- a/yt/yt/core/rpc/public.h
+++ b/yt/yt/core/rpc/public.h
@@ -136,6 +136,13 @@ struct TRequestQueueThrottlerConfigs
////////////////////////////////////////////////////////////////////////////////
+struct TTimeoutOptions
+{
+ std::optional<TDuration> Timeout;
+};
+
+////////////////////////////////////////////////////////////////////////////////
+
using NBus::EMultiplexingBand;
using TRequestId = TGuid;