It's somewhat hard to tell without the full context ...  but just one idea to get the discussion going :)   Are you checking the return value of the accept() call?  In some circumstances, accept may return undef (without having gotten any connection attempt, that is). In case of EINTR ($! eq "Interrupted system call") you just have to call accept again. This is more of an issue on some platforms (e.g. AIX) than on others (Linux), because some may automatically resume interrupted system calls — but in case of doubt, be prepared to handle it yourself...   (Google for '"interrupted system call" EINTR accept' (or some such) for more background.)

In any case, what I just said would only make sense if the problem is occurring sporadically (I'm not quite sure how to read your "Under certain circumstances"). If it reproducibly occurs with DBConnect_not_ok, then something else will likely be the problem ...


In reply to Re: Mysterious bad file descriptor after fork by almut
in thread Mysterious bad file descriptor after fork by gnork

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.