Commit 3f54bba7 authored by Simon Jenkins's avatar Simon Jenkins Committed by Anton Likhtarov

Set DEFAULT_CATCHUP_EVERY_N to 10 to get more accurate task expiration when busy event base

Summary:
when event base is busy we're timing out tasks too early.
BIG SCARY NOTE: I don't have the thrift knowledge to know if there's sideeffects of this, please let
me know if this change is harmful.

Test Plan:
tested internally

Reviewed By: davejwatson@fb.com

Subscribers: njormrod

FB internal diff: D1578466

Tasks: 4752162
parent 7b474bc6
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* Copyright 2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/io/async/AsyncTimeout.h>
......@@ -230,7 +228,7 @@ class HHWheelTimer : protected folly::AsyncTimeout,
uint64_t count_;
std::chrono::milliseconds now_;
static constexpr uint32_t DEFAULT_CATCHUP_EVERY_N = 100;
static constexpr uint32_t DEFAULT_CATCHUP_EVERY_N = 10;
uint32_t catchupEveryN_;
uint32_t expirationsSinceCatchup_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment