Re: [PATCH] log error details

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 14 Oct 2010 00:33:07 +1300

On 11/10/10 21:56, Tsantilas Christos wrote:
> The attached patch logs additional error details. It is an updated and
> improved version of the patch posted by Alex in squid-dev 2-3 months
> before. The corresponding squid-dev thread is "explaining internal errors".
>
> the "err_code" log format code which logs the ID of the error response
> served by squid and the "err_detail" which logs additional error
> informations, like a reason of the error, a syslog error code, or an
> exception ID.
>
> Also includes script utilities to allow developers find the exact
> position of the caught exceptions.
>
> Example log entries in access log file:
>
> ::1 ... ERR_ICAP_FAILURE/ICAP_XACT_OTHER 500 ...
> ::1 ... ERR_ICAP_FAILURE/ICAP_XACT_START 500 ...
> ::1 ... ERR_ICAP_FAILURE/EXCEPTION_START=198258959 500 ...
> ::1 ... ERR_CONNECT_FAIL/SYSERR=110 200 ...
> ::1 ... ERR_ICAP_FAILURE/EXCEPTION_START=198258211 500 ...
>
> To search the position of the exceptions caught on the above logs
> # ./scripts/calc-must-ids.sh 198258959
> ./src/adaptation/icap/ModXact.cc:863: 198258959
> Must(state.allowedPostview206);
>
> # ./scripts/calc-must-ids.sh 198258211
> ./src/adaptation/icap/ModXact.cc:115: 198258211 throw TexcHere("ICAP
> service is unusable");
>
>
> Please see patch preamble for more information.

Thank you.

I have doubts about the usefulness of the hash IDs. It will need to be
used with the build-info configuration option to be sure we have the
right Must(). I'm recalling the long period of confusion and not being
able to fix comm_write assert(fd>=0) because there were four identical
within 40 lines and the code changed between each report. Better than
nothing though I suppose.

* FYI: 8k of lines is very close to the size of the config parser tools
file once the automatically generated bits are inserted. Admittedly we
are doing things to reduce it, but its worth watching.

I request a hex coded ID for the exceptions display please. It halves
the text length (UDP and syslog limited lines) and makes it memorable as
well.
  You might even drop that down to "EXCEPTION_a10b" for size reducing.

* Can FileNameHashCached() be made a private static method of
TextException and work with the file and line details passed in to
cnstructor please?
   The singleton hack making local copies in almost every file .o is
likely to symbol clash on the more picky compilers like MacOSX.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.8
   Beta testers wanted for 3.2.0.2
Received on Wed Oct 13 2010 - 11:33:14 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 13 2010 - 12:00:05 MDT