• James Sedgwick's avatar
    add consumeUntilDrained API to NotificationQueue::Consumer · 35ed5364
    James Sedgwick authored
    Summary:
    ... and employ it in EventBase's destructor to stop leaking memory from unexecuted NotificationQueue-variety runInEventBaseThread() callbacks
    
    in addition to the attached task, this should also fix the root cause of the already-worked-around #5564342
    
    Test Plan:
    test no longer leaks.* on the other hand, IOThreadPoolExecutor::stop() no longer actually stops, it joins. I added comments to stop() in headers indicating that it should be treated as best-effort.
    
    * hilariously, this actually isn't true - there's a new leak of a thread local inside the io pool because callbacks can outlive the pool now. i'll leave a full explanation for the upcoming patch.
    
    Reviewed By: davejwatson@fb.com
    
    Subscribers: alandau, bmatheny, mshneer, trunkagent, fugalh, njormrod, folly-diffs@
    
    FB internal diff: D1682860
    
    Tasks: 5336655
    
    Signature: t1:1682860:1416347774:ac5f31fb72373992f425c93ac284a0cd27608db4
    35ed5364
EventBase.cpp 22.9 KB