Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid loop without yield when sockets are >60 (#138)
For Python 2.x, sleep_interval is 0 if len(self.sockets) is above self.ping_timeout (default: 60). With eventlet, self.sleep(0) looks it does not yield to the event loop, queueing work which is not processed. In this condition, the symptom is the server using 100% of CPU after some time, even when count of sockets drop below self.sockets. This fix forces sleep_interval to be a float, not equal to 0, forcing eventlet to yield, processing the queued work and avoiding CPU to be at 100%. This fix does nothing for Python 3.x.
- Loading branch information