Additional logging for errors in ByteBufferAsyncProcessor#190
Additional logging for errors in ByteBufferAsyncProcessor#190
Conversation
Since exceptions in this method may indicate a fatal error in the logging subsystem, the only place we're able to log them is LogLog.
| myAllDataProcessed = false; | ||
| Monitor.Pulse(myLock); | ||
| LogLog.Error(ex); | ||
| throw; |
There was a problem hiding this comment.
(Note that rethrowing with “throw;” instead of “throw e;” would “preserve the corrupting-ness”, meaning the whole process would probably be torn down as the re-thrown exception continued to propagate.)
There was a problem hiding this comment.
@hypersw suggests to use throw new Exception(e) to preserve the original callstack
There was a problem hiding this comment.
For this case, I don't think that's necessary.
Here, I want the following behavior from this code:
- If any exception (including the corrupted state one) is thrown, then the lock should be unlocked, and the exception should be logged without reentrancy into this code region, if possible (
LogLogallows such logging). - If the caller of this code uses
[HandleProcessCorruptedStateExceptions], then let it to handle the exception as it wants to. - If the caller of this code doesn't use
[HandleProcessCorruptedStateExceptions], then fall back to the default behavior (say, crash the whole process).
My point is that the logger internals shouldn't modify the defaults chosen by the application domain policy or by the caller. I don't think that this code should care about transforming corrupted state exceptions into ordinary ones.
There was a problem hiding this comment.
After an internal discussion, we've decided to make this behavior configurable.
Since exceptions in this method may indicate a fatal error in the logging subsystem, the only place we're able to log them is
LogLog.