Skip to content

Commit 02fe579

Browse files
committed
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.
1 parent 0f528f6 commit 02fe579

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cassandra/io/libevwrapper.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ Loop_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
1717

1818
self = (libevwrapper_Loop *)type->tp_alloc(type, 0);
1919
if (self != NULL) {
20-
self->loop = ev_default_loop(0);
20+
// select is the most portable backend, it is generally the most
21+
// efficient for the number of file descriptors we'll be working with,
22+
// and the epoll backend seems to occasionally leave write requests
23+
// hanging (although I'm not sure if that's due to a misuse of libev
24+
// or not)
25+
self->loop = ev_default_loop(EVBACKEND_SELECT);
2126
if (!self->loop) {
2227
PyErr_SetString(PyExc_Exception, "Error getting default ev loop");
2328
Py_DECREF(self);

0 commit comments

Comments
 (0)