Re: async-calls squid3/src Debug.h,1.10.4.4,1.10.4.5...

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Sun, 16 Mar 2008 21:42:37 -0600

On Sun, 2008-03-16 at 15:43 +0000, chtsanti wrote:
> Update of cvs.devel.squid-cache.org:/cvsroot/squid/squid3/src
...
> The xThrow function is similar to the old Throw function but in addition adds
> an extra check to see if the carrent call can handle exceptions or not. In the
> second case aborts imediatally squid.

Christos,

    AFAICT, this change prevents code from using try/catch blocks
outside of jobs that handle exceptions. I am not sure that is a good
idea.

I would just let Throw() throw (i.e., undo this change) until we have
more experience with this. Uncaught exceptions will kill Squid, which is
what we want. It would be better to catch them at the top/main() level
and print an intelligent debugging message, but that can wait.

Thank you,

Alex.

> + void xThrow(const char *message, const char *fileName, int lineNo){
> +
> + if (AsyncCall_Handling_Exceptions) {
> + // or should we let the exception recepient print the exception instead?
> +
> + if (fileName) {
> + debugs(0, 3, fileName << ':' << lineNo << ": exception" <<
> + (message ? ": " : ".") << (message ? message : ""));
> + } else {
> + debugs(0, 3, "exception" <<
> + (message ? ": " : ".") << (message ? message : ""));
> + }
> +
> + throw TextException(message, fileName, lineNo);
> + }
> +
> + debugs(0, 0, "failed to handle exception:" << message <<
> + "(" << fileName << ":" << lineNo << ")" );
> +
> + abort();
> + }
> +
Received on Sun Mar 16 2008 - 21:42:49 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Apr 01 2008 - 13:00:10 MDT