You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our application uses evconnlistener that accepts connection requests, creates a buffered event using bufferevent_socket_new for passed fd and assigns it to one of running event loop threads. It seems that in some rare cases file descriptor passed to evconnlistener callback is already invalid. In this case code called from bufferevent_socket_new eventually fails with a warning like that:
[warn] Epoll ADD(1) on fd 45 failed. Old events were 0; read change was 1 (add); write change was 0 (none): Bad file descriptor
but it does not cause a NULL return from bufferevent_socket_new. I think that it's a bug as I do not see an easy way to check whether a file descriptor is valid without actually using it. Probably a result of evbuffer_add_cb define is not checked.
The text was updated successfully, but these errors were encountered:
So the only way to get an EBADF from event_add's backend in epoll would seem to be passing one that you've already closed, right? If it's been closed on the other side, it shouldn't give an EBADF.
Strange, but it has never happened again after this issue was submitted. May be it was caused by some pitfalls in multithreading code. I'm closing this issue as I do not have enough information to provide.
Our application uses evconnlistener that accepts connection requests, creates a buffered event using bufferevent_socket_new for passed fd and assigns it to one of running event loop threads. It seems that in some rare cases file descriptor passed to evconnlistener callback is already invalid. In this case code called from bufferevent_socket_new eventually fails with a warning like that:
[warn] Epoll ADD(1) on fd 45 failed. Old events were 0; read change was 1 (add); write change was 0 (none): Bad file descriptor
but it does not cause a NULL return from bufferevent_socket_new. I think that it's a bug as I do not see an easy way to check whether a file descriptor is valid without actually using it. Probably a result of evbuffer_add_cb define is not checked.
The text was updated successfully, but these errors were encountered: