-
Notifications
You must be signed in to change notification settings - Fork 25
Log/Handle exceptions in ProtonTransport.handleSocketBuffer #94
Description
We just had a case where there was a bug in one of our onUpdated handlers used in ProtonSender#send(Message message, Handler<ProtonDelivery> onUpdated). The handler threw an exception although it shouldn't have.
It took a while to find this bug because there was no log output of the exception. We only saw strange follow-up errors that didn't point to the original cause.
It was only when we analyzed a heap dump and found the ProtonTransport.collector to have a long list of unprocessed events (with a delivery event at its head), that we got the idea. The unprocessed events caused timeout errors, hence the follow-up errors above.
It would be helpful for ProtonTransport.handleSocketBuffer to at least log any exceptions thrown within the event-processing while loop.
I guess one could argue, that it could make sense to also set failed = true and disconnect in that case. Provided the failed handler throws the exception with each invocation, the ProtonTransport instance is unusable in that case anyway.
(I see that this issue is similar to #93, the focus in this issue here isn't on an exposed exceptionHandler though, rather it's about making ProtonTransport more robust and improving error logging.)