The bug report said that it happened, in one case, when he hit escape in the browser. So I doubt it was the kernel. It might not have been Perl or the script, either. It could be a non-kernel library. But the situation was described as and even sounds like it would be a situation where the script (which is what the programmer "has full control over") wasn't the software closing the socket. And the report says that there were other situations that caused the same problem.

That this violates your sensibilities is clear, but that seems poor justification for going on and on like this, just ignoring the evidence that contradicts that "the developer has full control over the lifespan of the socket". I agree that it is a bit unexpected and unfortunate that there are libraries of some kind that cause a socket to lose its file descriptor number.

But even if it turns out that it was a mistake on the part of the Perl script, then we just have a demonstration of it not being a trivial matter to find how the script is closing a socket unexpectedly. Debugging can be hard. I hope that isn't a surprise to you.

"In a perfect world" the programmer will have full control over the socket's fd's lifespan and will have no difficulty fixing when their control over the lifespan causes a fd to be closed other than the place where fds that are in the IO::Select object are managed. But we have clear evidence that the world isn't perfect.

The way IO::Select behaves in such a situation is terrible. It is trivial to fix it to at least complain when that situation happens. There is no excuse for silently doing stupid stuff in that situation, despite your many attempts to make excuses. It sounds like it isn't particularly hard to make it actually work well in that situation, so that fix should just be applied. This isn't a "just update the documentation" type of bug.

And in a perfect world, bugs in Perl and the kernel and all libraries will be fixed quickly and hardly anybody will be bothered by bugs so software doesn't need to take trivial steps to avoid silently doing stupid stuff when such a bug appears (especially when more than one case of such a bug was already reported in-the-wild).

- tye        


In reply to Re^7: Does IO::Select work? (perfect) by tye
in thread Does IO::Select work? Anywhere? by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.