You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Jean-Francois Poilpret <jf...@yahoo.fr> on 2007/02/23 11:51:33 UTC

Problem with LoggingInterceptorFactory

Hi,

I have just discovered an unexpected behavior with logging interceptors
generated by HiveMind's LoggingInterceptorFactory.

When an Error is thrown by a method in the intercepted service, it never
gets logged!

After checking LoggingInterceptorFactory source code I found out that only
Exceptions and RuntimeExceptions are caucht and logged by the generated
interceptor.

Although I understand that catching Error is generally not considered good
practice, I believe that for logging purpose it could be judged acceptable,
not to say good advice.

Let me explain my case (or how I discovered this problem):

In HiveBoard server (HiveMind-based) one method called by HiveMind client
(through HiveRemoting facilities) would run out of memory (on the server).
Then the OutOfMemoryError was silently (no log on server side) transported
back to the client (through the Hessian protocol that is used by
HiveRemoting), and would of course display on the client as an OutOfMemory
error (due to client memory needs!).
Since OutOfMemoryError do not include stack traces, I even had no clue that
the problem occurred on server! So I spent a few hours adding and analysing
log traces on client, then analysing in detail log traces from server to
finally find out that the called method would never end (no END log by the
interceptor).

I believe this behavior for a logging interceptor is not correct: we would
expect ANY exception (I mean Throwable) logged by this interceptor, else the
server might always appear to run fine. In this case, I was lucky because
this occurred during my tests, but what would happen in a production system
where maybe client side users would not even report the problem? The server
admin would hardly notice the problem on the server!

Should I submit a JIRA for this problem?

Cheers

Jean-Francois


	

	
		
___________________________________________________________________________ 
Yahoo! Mail r�invente le mail ! D�couvrez le nouveau Yahoo! Mail et son interface r�volutionnaire.
http://fr.mail.yahoo.com

Re: Problem with LoggingInterceptorFactory

Posted by James Carman <ja...@carmanconsulting.com>.
I'd say submit a JIRA.  If, for some reason, it is decided that we
won't do this, it'll be documented as a comment on the issue.  It was
probably done because you may not be able to execute the log statement
anyway because of the error.  Put it in JIRA, though, and we can
discuss it on there.  Good catch, though.

On 2/23/07, Jean-Francois Poilpret <jf...@yahoo.fr> wrote:
> Hi,
>
> I have just discovered an unexpected behavior with logging interceptors
> generated by HiveMind's LoggingInterceptorFactory.
>
> When an Error is thrown by a method in the intercepted service, it never
> gets logged!
>
> After checking LoggingInterceptorFactory source code I found out that only
> Exceptions and RuntimeExceptions are caucht and logged by the generated
> interceptor.
>
> Although I understand that catching Error is generally not considered good
> practice, I believe that for logging purpose it could be judged acceptable,
> not to say good advice.
>
> Let me explain my case (or how I discovered this problem):
>
> In HiveBoard server (HiveMind-based) one method called by HiveMind client
> (through HiveRemoting facilities) would run out of memory (on the server).
> Then the OutOfMemoryError was silently (no log on server side) transported
> back to the client (through the Hessian protocol that is used by
> HiveRemoting), and would of course display on the client as an OutOfMemory
> error (due to client memory needs!).
> Since OutOfMemoryError do not include stack traces, I even had no clue that
> the problem occurred on server! So I spent a few hours adding and analysing
> log traces on client, then analysing in detail log traces from server to
> finally find out that the called method would never end (no END log by the
> interceptor).
>
> I believe this behavior for a logging interceptor is not correct: we would
> expect ANY exception (I mean Throwable) logged by this interceptor, else the
> server might always appear to run fine. In this case, I was lucky because
> this occurred during my tests, but what would happen in a production system
> where maybe client side users would not even report the problem? The server
> admin would hardly notice the problem on the server!
>
> Should I submit a JIRA for this problem?
>
> Cheers
>
> Jean-Francois
>
>
>
>
>
>
> ___________________________________________________________________________
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
> http://fr.mail.yahoo.com
>
>