userver: ydb::DistLockSettings Struct Reference
Loading...
Searching...
No Matches
ydb::DistLockSettings Struct Reference

#include <userver/ydb/dist_lock/settings.hpp>

Detailed Description

A set of tweak-able settings for ydb::DistLockWorker.

Definition at line 15 of file settings.hpp.

Public Attributes

std::chrono::milliseconds session_timeout {5000}
 For how long we will try to restore session after a network failure before dropping it. Corresponds to TSessionSettings::Timeout.
 
std::chrono::milliseconds restart_session_delay {1000}
 Backoff before attempting to reconnect session after it returns "permanent failure".
 
std::chrono::milliseconds acquire_interval {100}
 Backoff before repeating a failed Acquire call.
 
std::chrono::milliseconds restart_delay {100}
 Backoff before calling DoWork again after it returns or throws.
 
std::chrono::milliseconds cancel_task_time_limit {5000}
 Time, within which a cancelled DoWork is expected to finish.
 

Member Data Documentation

◆ acquire_interval

std::chrono::milliseconds ydb::DistLockSettings::acquire_interval {100}

Backoff before repeating a failed Acquire call.

Definition at line 37 of file settings.hpp.

◆ cancel_task_time_limit

std::chrono::milliseconds ydb::DistLockSettings::cancel_task_time_limit {5000}

Time, within which a cancelled DoWork is expected to finish.

Ignoring cancellations for this long can lead to a "brain split" where DoWork is running on multiple hosts. Practically speaking, this time can be computed as:

TNodeSettings::SessionGracePeriod - TSessionSettings::Timeout

and should be set to that or a smaller value.

Definition at line 51 of file settings.hpp.

◆ restart_delay

std::chrono::milliseconds ydb::DistLockSettings::restart_delay {100}

Backoff before calling DoWork again after it returns or throws.

Definition at line 40 of file settings.hpp.

◆ restart_session_delay

std::chrono::milliseconds ydb::DistLockSettings::restart_session_delay {1000}

Backoff before attempting to reconnect session after it returns "permanent failure".

If the network connection to the coordination node is temporarily lost, some normal reconnect attempts will be performed within session_timeout. After the session finally gives up, ydb::DistLockWorker will attempt to restart the coordination session after this time.

Definition at line 34 of file settings.hpp.

◆ session_timeout

std::chrono::milliseconds ydb::DistLockSettings::session_timeout {5000}

For how long we will try to restore session after a network failure before dropping it. Corresponds to TSessionSettings::Timeout.

If the network connection to the coordination node is temporarily lost, some normal reconnect attempts will be performed within session_timeout. After the session finally gives up, YDB Coordinator drops the active lock held by the current host, if any.

Definition at line 24 of file settings.hpp.


The documentation for this struct was generated from the following file: