GitHub PushEvent at 2014-10-06 22:49:49
Repository: nsca
Actor: mbattersby
Payload: {"shas":[["c0c0a8c9e1e1d7db525da9e8940a2b468d03f514","cddc7081f5b1fef0c4632af4d30cbe5cf7bd916c@unimelb.edu.au","Prevent a hang where accept returns a just-closed fd.\n\nIn SINGLE_PROCESS_DAEMON mode, the handle_events loop is logically faulty.\naccept() can return a FD which is has recently been closed and is awaiting\ncleanup, detected by revents&POLLNVAL.\n\nThis can cause calling of the wrong handler, and doing recv() on a socket\nthat hasn't been set O_NONBLOCK yet.\n\nExample of the fault:\n\n  * a client FD is connected and set events=POLLIN / handle_connection_read\n  * handle_connection_read gets an error/EOF and closes the fd\n  * a new connection comes in pending accept\n  * new handle_events() loop\n  * poll() called, listen_sock revents=POLLIN, client_fd revents=POLLNVAL\n  * accept() returns the same client_fd, sets events|=POLLOUT (+POLLIN)\n  * test (events&POLLIN)&&(revents&POLLNVAL) true\n  * run handle_connection_read on the new socket, calling recv() on blocking fd\n\nThis commit works around the problem by not calling the handler but the problem\nof accept() happening before POLLNVAL cleanup is handled handled remains.","Mike Battersby",false],["035f4c48386ad020084a3f0c76bec85968df888e","cddc7081f5b1fef0c4632af4d30cbe5cf7bd916c@unimelb.edu.au","Merge branch 'poll-loop-fixes'","Mike Battersby",false],["32d3b2efee39d32fd1fe919e7ed31cdec03fe90f","cddc7081f5b1fef0c4632af4d30cbe5cf7bd916c@unimelb.edu.au","Move client fd O_NONBLOCK into accept_connection.","Mike Battersby",false],["4e068f0ac98d7095d6da05a7911de38d72e7c359","cddc7081f5b1fef0c4632af4d30cbe5cf7bd916c@unimelb.edu.au","Merge branch 'safer-ononblock'","Mike Battersby",true]],"size":4,"ref":"refs/heads/master","head":"4e068f0ac98d7095d6da05a7911de38d72e7c359"}