On Wed, 20 Jun 2012 07:27:38 -0600
Eduardo Silva <[email protected]> wrote:

> > After closing, we occasionally get a false write event on an already-closed 
> > connection. Do not try to re-close in that case.
> 
> When some event is triggered from epoll and the associated callback
> (event_write, event_read..etc) returns 0, means that the connection
> keeps alive, so it must return -1 so then it can invoke the
> event_close properly, the event_close is not just to close a file
> descriptor, also put aware everyone about that connection has been
> closed so an action can be taken. Remember that plugins depends of the
> events triggered so we cannot return '0' when a connection was close.
> 
> Please explain the problem that you face in the CGI plugin when it returns -1.

The connection is already closed via the event_close callback, that's why the 
cs does not exist. After it's closed, sometimes epoll sends a false write event.

Now, without this patch, this means monkey tries to close fd, say, 19, which is 
already closed. Fd 19 might now refer to a new file. Closing it will cause 
instability and errors - some other thread has its fd closed from under it when 
it tries to read or write to it.


It also prints out a epoll_ctl error message, because fd 19 has already been 
removed from the epoll_fd.

- Lauri
_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to