HiveMind LoggingInterceptor does not log java.lang.Error
--------------------------------------------------------

                 Key: HIVEMIND-202
                 URL: https://issues.apache.org/jira/browse/HIVEMIND-202
             Project: HiveMind
          Issue Type: Bug
          Components: framework
    Affects Versions: 1.1.1
         Environment: Any
            Reporter: Jean-Francois Poilpret


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!


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to