aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-28 21:10:38 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-28 21:10:38 +0000
commita46a98bc7fd21a076470c06d560f42b5c7862b88 (patch)
treecaa66ecd38300065473412aa8ea5dc3cd1926402 /storage
parent4fa7d094dfba8affcf7a557ced76cc8ef74004cd (diff)
Add a simple adjustTimeoutByDetectedHz to compute a suitable timeout/naptime based on base VESPA_TIMER_HZ to use for random waiting
when doing a poll based appraoch.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
index d501172731a..8b172743d27 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_pool.cpp
@@ -15,7 +15,7 @@ DistributorStripePool::DistributorStripePool(bool test_mode, PrivateCtorTag)
_mutex(),
_parker_cond(),
_parked_threads(0),
- _bootstrap_tick_wait_duration(vespalib::from_s(1.0/vespalib::getVespaTimerHz())),
+ _bootstrap_tick_wait_duration(vespalib::adjustTimeoutByDetectedHz(1ms)),
_bootstrap_ticks_before_wait(10),
_single_threaded_test_mode(test_mode),
_stopped(false)
diff --git a/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp b/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp
index 94e4dc648cc..ae5445da620 100644
--- a/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp
+++ b/storage/src/vespa/storage/distributor/distributor_stripe_thread.cpp
@@ -11,7 +11,7 @@ DistributorStripeThread::DistributorStripeThread(TickableStripe& stripe,
DistributorStripePool& stripe_pool)
: _stripe(stripe),
_stripe_pool(stripe_pool),
- _tick_wait_duration(vespalib::from_s(1.0/vespalib::getVespaTimerHz())),
+ _tick_wait_duration(vespalib::adjustTimeoutByDetectedHz(1ms)),
_mutex(),
_event_cond(),
_park_cond(),