Fix RequestContext held too long issue in EventBase
authorPingjia Shan <pingjia@fb.com>
Tue, 5 Dec 2017 21:03:44 +0000 (13:03 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 5 Dec 2017 21:06:41 +0000 (13:06 -0800)
commitbda67fde120837b77ddab74f23abcb22ae5b3029
tree88036afc792880fc292dce9477953856488674e7
parent5a07e203d79324b68d69f294fa38e43b9671e9b1
Fix RequestContext held too long issue in EventBase

Summary:
Upon debugging for the attached task, it appears to me the problem are in two places:
. After a callback has been run, context_ wasn't reset
. After a callback has been canceled, context_ wasn't reset

In this diff:
. Fix these two places.
. Updating unit tests to cover these two cases.

Reviewed By: yfeldblum

Differential Revision: D6465788

fbshipit-source-id: 85b3b29dc80c9f3971c85f302385d41ded44fa0e
folly/io/async/EventBase.cpp
folly/io/async/EventBase.h
folly/io/async/test/EventBaseTest.cpp