Commit 4dc81d1a authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Handle spurious poll returning 0 when we have high load at process startup time

Summary: Handle spurious poll returning 0 when we have high load at process startup time

Reviewed By: danobi

Differential Revision: D20821506

fbshipit-source-id: 93ec91f0908f44e5210974e1cf3f30ac7aa38950
parent a5909bd1
......@@ -411,7 +411,12 @@ size_t PollIoBackend::processActiveEvents() {
// prevent the callback from freeing the aioIoCb
ioCb->useCount_++;
(*event_ref_callback(ev))((int)ev->ev_fd, ev->ev_res, event_ref_arg(ev));
// handle spurious poll events that return 0
// this can happen during high load on process startup
if (ev->ev_res) {
(*event_ref_callback(ev))(
(int)ev->ev_fd, ev->ev_res, event_ref_arg(ev));
}
// get the event again
event = ioCb->event_;
ev = event ? event->getEvent() : nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment