Set DEFAULT_CATCHUP_EVERY_N to 10 to get more accurate task expiration when busy...
authorSimon Jenkins <sjenkins@fb.com>
Thu, 25 Sep 2014 21:25:47 +0000 (14:25 -0700)
committerAnton Likhtarov <alikhtarov@fb.com>
Fri, 26 Sep 2014 22:26:26 +0000 (15:26 -0700)
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

index 5e90b2f6890123d6a93a55d4024cea59619534a7..36a7d0f2a5badcd6451bb7ed17f17cdf77387c2e 100644 (file)
@@ -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 <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_;