Use fewer keep-alives in VirtualEventBase::keepAliveRelease
authorYedidya Feldblum <yfeldblum@fb.com>
Fri, 6 Oct 2017 00:02:00 +0000 (17:02 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 6 Oct 2017 00:13:53 +0000 (17:13 -0700)
Summary:
[Folly] Use fewer keep-alives in `VirtualEventBase::keepAliveRelease`.

{D5982132} mistakenly used `VirtualEventBase::add`, which holds a keep-alive on the master `EventBase`, instead of calling `EventBase::add` directly.

(Note: this ignores all push blocking failures!)

Reviewed By: andriigrynenko

Differential Revision: D5992403

fbshipit-source-id: f427025c06f01e6a93d6eae8a051c3553f58be20

folly/io/async/VirtualEventBase.h

index ebf928aa6fc767401a616139e66df05595425042..539e77060a11e9d04918d218551e1616617cf8f9 100644 (file)
@@ -140,8 +140,8 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager {
   }
 
   void keepAliveRelease() override {
-    if (!inRunningEventBaseThread()) {
-      return add([=] { keepAliveRelease(); });
+    if (!evb_.inRunningEventBaseThread()) {
+      return evb_.add([=] { keepAliveRelease(); });
     }
     if (loopKeepAliveCountAtomic_.load()) {
       loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0);