Skip to content

Commit

Permalink
Optimized default timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Feb 19, 2016
1 parent b751564 commit 38f5591
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ class AbstractServer : protected IAllocationRequestHandler
*/
bool guessIfAllDynamicNodesAreAllocated(
const MonotonicDuration& allocation_activity_timeout =
MonotonicDuration::fromMSec(protocol::NodeStatus::OFFLINE_TIMEOUT_MS)) const
MonotonicDuration::fromMSec(Allocation::MAX_REQUEST_PERIOD_MS * 2),
const MonotonicDuration& min_uptime = MonotonicDuration::fromMSec(6000)) const
{
const MonotonicTime ts = node_.getMonotonicTime();

/*
* If uptime is not large enough, the allocator may be unaware about some nodes yet.
*/
const MonotonicDuration uptime = ts - started_at_;
if (uptime < allocation_activity_timeout)
if (uptime < max(allocation_activity_timeout, min_uptime))
{
return false;
}
Expand Down

0 comments on commit 38f5591

Please sign in to comment.