Use select backend for libev

It appears that the epoll backend may have been causing the hanging
write requests at the connection level, which appears to be the last
major cause of PYTHON-27, PYTHON-29, and PYTHON-32.  For now, we will
hardcode select as the libev backend; this would be the best choice in
almost all circumstances, in any case.
This commit is contained in:
Tyler Hobbs
2013-12-18 11:05:03 -06:00
parent 0f528f6952
commit 02fe5792a8

View File

@@ -17,7 +17,12 @@ Loop_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
self = (libevwrapper_Loop *)type->tp_alloc(type, 0);
if (self != NULL) {
self->loop = ev_default_loop(0);
// select is the most portable backend, it is generally the most
// efficient for the number of file descriptors we'll be working with,
// and the epoll backend seems to occasionally leave write requests
// hanging (although I'm not sure if that's due to a misuse of libev
// or not)
self->loop = ev_default_loop(EVBACKEND_SELECT);
if (!self->loop) {
PyErr_SetString(PyExc_Exception, "Error getting default ev loop");
Py_DECREF(self);