Patch: fix libeio cancellation

Hongli Lai hongli at phusion.nl
Fri Aug 29 00:07:57 CEST 2014


On Thu, Aug 28, 2014 at 5:41 AM, Marc Lehmann <schmorp at schmorp.de> wrote:
>> Here's how libeio loses the fd:
>
> libeio can't lose the fd, as libeio doesn't own it. the caller creates the
> fd and needs to take care of it. if you want it closede, you cna close it
> in the destroy callback.
>
>> 7. ETP_FINISH sees that the cancel flag is 1, and returns. The
>> callback is never called, and libeio never attempts to close the file
>> descriptor returned by open(). The fd is now lost.
>
> libeio never closes fds for you unless you explicitly ask it to (via
> EIO_CLOSE).

With "lost" I do not mean that libeio closes it. I meant that the file
descriptor still exists, but nobody knows what its number is.

When ETP_FINISH sees that the cancel flag is 1, and returns, where did
the file descriptor number go? How can one close it now that the
callback will not be called?

-- 
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: info at phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)



More information about the libev mailing list