From 3f54bba77387d4967f37abc9b7e279c418bb3a52 Mon Sep 17 00:00:00 2001 From: Simon Jenkins Date: Thu, 25 Sep 2014 14:25:47 -0700 Subject: [PATCH] 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 --- folly/io/async/HHWheelTimer.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/folly/io/async/HHWheelTimer.h b/folly/io/async/HHWheelTimer.h index 5e90b2f6..36a7d0f2 100644 --- a/folly/io/async/HHWheelTimer.h +++ b/folly/io/async/HHWheelTimer.h @@ -1,21 +1,19 @@ /* - * 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 @@ -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_; -- 2.34.1