Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle return events for poll() (#836)
On MacOS, there was a situation where poll() had POLLHUP in revents, which was not being handled by WaitForEvent. This caused poll to continuously run, taking CPU time (up to 100%). In spite of requesting POLLERR | POLLIN or POLLERR | POLLOUT, poll will also potentially return POLLHUP and POLLNVAL. [From the opengroup poll spec:](https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html) "In addition, poll() shall set the POLLHUP, POLLERR, and POLLNVAL flag in revents if the condition is true, even if the application did not set the corresponding bit in events." We've removed the request for POLLERR from the file descriptor as it is unnecessary and misleading. This fix addresses the CPU usage on MacOS 11.6 when running a monitor that cannot connect to its nodes. Co-authored-by: Jacob Champion <pchampion@vmware.com>
- Loading branch information