lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> It doesn't really make sense to me, but I am sure there is a good
> reason for it.

I already explained the reason. If you think it is not a good one, too
bad; it is the only one. Once more: The call can fail due to lack of
resources, but there is a good chance that the error itself will free
those resources (e.g., stack space); so, the next call can succeed where
the previous one failed. The option would be not to repeat the call, and
therefore not to close whatever should be closed.

Note that, if the close method is error-proof, this is entirely
a non issue.


> I was trying to figure out where in the code there is a
> retry logic - but it isn't obvious. So it is a side effect of the
> error handling I assume?

The upvalue is removed from the open list only after the call. If
there is an error, that sequence is interrupted, and the upvalue
is not removed from the list. It would be easy to remove it
before the call, if we preferred not to do the call again.

-- Roberto