I have a Perl CGI script that runs on Apache on Linux using mod_cgi. The script takes a XML document POSTed by the client, parses it, validates the data, places the order into the Oracle database, sends a response back to the customer, then creates a log entry of what happened. Unfortnately I have one customer who insists on not waiting for an acknowlegment (even tho he requests one) but drops the connection as soon as the data is on the wire. This (I think) is causing Apache to terminate the CGI process before it completes the processing. Sometimes the order gets placed, sometimes it does not. Since logging happens at the end, I don't always know an order was attempted.

Is there any way I can capture this early terminaition so I can handle it intelligently? I know how to set up a signal handler but I don't know what signal -- if any -- to look for.


In reply to Detecting early termination by client by enemyofthestate

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.