jetty.project
jetty.project copied to clipboard
Fix async callback failure leading to `IllegalArgumentException` in `SocketChannel.write()`
trafficstars
Prototype fix for #11854
This is a slightly modified version of the original proposal that does not require any modification to the Callback interface: introduce a new CancelableCallback class with a static cancel(Callback, Throwable) helper that actually calls failed() on the callback but not before wrapping the given throwable with a private, maker one that is then detected by the CancelableCallback.failed() implementation to discriminate between canceling and failing logic.
See #11857 for an alternative which adds a cancel() method to Callback.
Abandoned in favor of https://github.com/jetty/jetty.project/pull/11951