{"action":"created","issue":{"url":"https://api.github.com/repos/libevent/libevent/issues/341","repository_url":"https://api.github.com/repos/libevent/libevent","labels_url":"https://api.github.com/repos/libevent/libevent/issues/341/labels{/name}","comments_url":"https://api.github.com/repos/libevent/libevent/issues/341/comments","events_url":"https://api.github.com/repos/libevent/libevent/issues/341/events","html_url":"https://github.com/libevent/libevent/issues/341","id":144762752,"number":341,"title":"Mutex never unlocked on accept() error","user":{"login":"lacombar","id":34272,"avatar_url":"https://avatars.githubusercontent.com/u/34272?v=3","gravatar_id":"","url":"https://api.github.com/users/lacombar","html_url":"https://github.com/lacombar","followers_url":"https://api.github.com/users/lacombar/followers","following_url":"https://api.github.com/users/lacombar/following{/other_user}","gists_url":"https://api.github.com/users/lacombar/gists{/gist_id}","starred_url":"https://api.github.com/users/lacombar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacombar/subscriptions","organizations_url":"https://api.github.com/users/lacombar/orgs","repos_url":"https://api.github.com/users/lacombar/repos","events_url":"https://api.github.com/users/lacombar/events{/privacy}","received_events_url":"https://api.github.com/users/lacombar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-31T01:29:06Z","updated_at":"2016-04-01T07:30:44Z","closed_at":"2016-03-31T21:05:50Z","body":"Some of our server has been triggering an error during accept(), resulting in the following log:\r\n\r\n```\r\n[warn] Error from accept() call\r\n```\r\n\r\nHowever, this code path does not release the lock, leading all subsequent operation on the listener to deadlock. The following change (untested) might provide a fix for this issue:\r\n\r\n```\r\n--- a/listener.c\r\n+++ b/listener.c\r\n@@ -439,10 +439,10 @@ listener_read_cb(evutil_socket_t fd, short what, void *p)\r\n                UNLOCK(lev);\r\n                errorcb(lev, user_data);\r\n                LOCK(lev);\r\n-               listener_decref_and_unlock(lev);\r\n        } else {\r\n                event_sock_warn(fd, \"Error from accept() call\");\r\n        }\r\n+       listener_decref_and_unlock(lev);\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/libevent/libevent/issues/comments/204290396","html_url":"https://github.com/libevent/libevent/issues/341#issuecomment-204290396","issue_url":"https://api.github.com/repos/libevent/libevent/issues/341","id":204290396,"user":{"login":"lacombar","id":34272,"avatar_url":"https://avatars.githubusercontent.com/u/34272?v=3","gravatar_id":"","url":"https://api.github.com/users/lacombar","html_url":"https://github.com/lacombar","followers_url":"https://api.github.com/users/lacombar/followers","following_url":"https://api.github.com/users/lacombar/following{/other_user}","gists_url":"https://api.github.com/users/lacombar/gists{/gist_id}","starred_url":"https://api.github.com/users/lacombar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacombar/subscriptions","organizations_url":"https://api.github.com/users/lacombar/orgs","repos_url":"https://api.github.com/users/lacombar/repos","events_url":"https://api.github.com/users/lacombar/events{/privacy}","received_events_url":"https://api.github.com/users/lacombar/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T07:30:44Z","updated_at":"2016-04-01T07:30:44Z","body":"True, then that decref make sense, my bad.\r\n\r\nI was looking for some kind of `listerner_incref(lev)` and not open coding of the increment :-)"}}