Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache-xroot: handle outbound errors on channel promise
Motivation: Refer to the final comments in GH 6909 "Proxy xrootd door keep restarting" #6909 Occasionally we will find unexpected errors on the pipeline being reported as with the example below ``` 04 Dec 2022 04:07:55 (Xrootd-dcdndoor03-externalsubnet) [] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. io.netty.channel.StacklessClosedChannelException: null at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source) ``` The problem arises from the asymmetical nature of exception propagation on the Netty pipeline. For exceptions on inbound/read, all that is needed is for the last handler in the pipeline (the "TOP") to implement exceptionCaught. This is done by the final handlers in the door, proxy and pool pipelines. However, for outbound exceptions, one needs to add a listener to the channel future or channel promise; this needs to be done at the very beginning of the outbound pipeline ("BOTTOM"); the listener allows exceptions on channel write to invoke the uncaughtException method on the inbound handlers. Modification: Create an OutboundHandler that simply adds the listener and add it first to all pipelines. Result: We should no longer see exceptions such as the one above reporting no exception handler to handle the exception. Target: master Request: 8.2 Request: 8.1 (Without proxy) Request: 8.0 (Without proxy) Request: 7.2 (Without proxy) Closes: #6909 Patch: https://rb.dcache.org/r/13833/ Requires-notes: yes Acked-by: Tigran
- Loading branch information