mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
chore: add timeout to replication sockets (#3434)
* chore: add timeout fo replication sockets Master will stop the replication flow if writes could not progress for more than K millis. --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io> Signed-off-by: Roman Gershman <romange@gmail.com> Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
This commit is contained in:
parent
7c84b8e524
commit
1cbfcd4912
10 changed files with 133 additions and 41 deletions
|
@ -13,9 +13,9 @@
|
|||
|
||||
using namespace facade;
|
||||
|
||||
ABSL_FLAG(uint32_t, replication_stream_timeout, 500,
|
||||
"Time in milliseconds to wait for the replication output buffer go below "
|
||||
"the throttle limit.");
|
||||
ABSL_FLAG(uint32_t, replication_timeout, 10000,
|
||||
"Time in milliseconds to wait for the replication writes being stuck.");
|
||||
|
||||
ABSL_FLAG(uint32_t, replication_stream_output_limit, 64_KB,
|
||||
"Time to wait for the replication output buffer go below the throttle limit");
|
||||
|
||||
|
@ -155,8 +155,8 @@ void JournalStreamer::ThrottleIfNeeded() {
|
|||
if (IsStopped() || !IsStalled())
|
||||
return;
|
||||
|
||||
auto next = chrono::steady_clock::now() +
|
||||
chrono::milliseconds(absl::GetFlag(FLAGS_replication_stream_timeout));
|
||||
auto next =
|
||||
chrono::steady_clock::now() + chrono::milliseconds(absl::GetFlag(FLAGS_replication_timeout));
|
||||
size_t inflight_start = in_flight_bytes_;
|
||||
size_t sent_start = total_sent_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue