-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentSourcePublisher throws from request #11363
Comments
@sbordet do you agree this is a bug? |
Actually @lorban do you think this is a violation of our |
We throw for "must not happen" kind of situations. Returning an error chunk is more like a failure that may happen (e.g. early EOF). I agree that we should protect a call to Why there is a call to |
Interesting discussion back in 2014 about throwing from the reactive Subscription APIs.
When I first read this, it felt like you were describing a fatal error. To the reactive folks back in 2014 a fatal error is only something that will have a high likelyhood of shutting down the JVM. (think OOM, VMError, etc) |
IMHO
|
@sbordet I've not yet looked into the cause of the late call to read, but it is from a unit test and for all we know it could be testing error handling. I.e. what happens if the connection closes early. I was looking for a normal termination of the Flux, but didn't see one.. but thought that we should say least see an onError I'd expect the stack trace would still be visible if it was reported to onError and was not expected. I'll prepare a branch with this fixed and see how that affects the spring test... Probably won't fix it, but we'll see. |
and if you only catch Exception you can still end up with your pants around your ankles if somebody throws a Runtime! I'll fix |
Fixes #11363 by ensuring that read never throws, but instead returns an Error chunk.
Fixes #11363 by ensuring that read never throws, but instead returns an Error chunk.
Jetty version(s)
Jetty Environment
12
Description
In the spring integration branch we are seeing the following exception:
However, the reactive specification says that "Calling Subscription.request MUST return normally". So our
ContentSourcePublisher
is breaking that rule and throwing rather than callingonError
The text was updated successfully, but these errors were encountered: