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 * Copyright 2014 Facebook, Inc.
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information * Licensed under the Apache License, Version 2.0 (the "License");
* regarding copyright ownership. The ASF licenses this file * you may not use this file except in compliance with the License.
* to you under the Apache License, Version 2.0 (the * You may obtain a copy of the License at
* "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 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, * Unless required by applicable law or agreed to in writing, software
* software distributed under the License is distributed on an * distributed under the License is distributed on an "AS IS" BASIS,
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* KIND, either express or implied. See the License for the * See the License for the specific language governing permissions and
* specific language governing permissions and limitations * limitations under the License.
* under the License.
*/ */
#pragma once #pragma once
#include <folly/io/async/AsyncTimeout.h> #include <folly/io/async/AsyncTimeout.h>
...@@ -230,7 +228,7 @@ class HHWheelTimer : protected folly::AsyncTimeout, ...@@ -230,7 +228,7 @@ class HHWheelTimer : protected folly::AsyncTimeout,
uint64_t count_; uint64_t count_;
std::chrono::milliseconds now_; 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 catchupEveryN_;
uint32_t expirationsSinceCatchup_; 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