jetty.project
jetty.project copied to clipboard
HttpChannelState does not satisfy the contract of Content.Source
Jetty version(s) 12.0.11
Jetty Environment any
Java version/vendor (use: java -version)
any
OS type/version any
Description Fail method contract: If read() has returned a last chunk, this is a no operation.
How to reproduce? Relates to https://github.com/jetty/jetty.project/pull/11804 Remove if clause and run HttpChannelTest https://github.com/jetty/jetty.project/pull/11804/files#diff-a2016d36a06123b85fc4e54ab2467b6cfbe51398c8fd624706d1dae9fc3c4e29R231
We are throwing a "content read fully exception".
@sbordet @lorban I think this is indeed outside of the contract. Not only do we act on a call to HttpChannel.ChannelRequest#failed(Throwable) after all the content is read, but we simply call HttpChannelState.onFailure(Throwable), which is a much more significant failure as it also fails the write side.
I guess we should be able to fail the read side and continue writing content to the response?
I'm not seeing an immediate easy fix.
Note you can also reproduce in my branch: #11849 in a similar way