You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of an IOException on calling getInputStreaminitContainerRequest failed right away with the same IOException in 2.43.
After this change the getInputStream is not called at all in initContainerRequest and everything is fine for now.
Nevertheless, at the first call on the EntityStream e.g.: requestContext.getEntityStream().available() the call will fail with your UncheckedIOException. But at this point in time we long left the try-catch-block and the UncheckedIOException is being propagated through the system.
Please check mheinzerling@1473d8d for a simple test demonstrating the old behavior.
In both cases I just extracted a static method to reduce the test setup and the mock*Request methods are also identical.
As mentioned above, I don't know what you tried to achieve with this change, so I can't recommend a fix. But at least in our system, I didn't notice any issue in just rolling back this snippet.
Please don't hesitate to send me a message if there are further questions. Thanks.
The text was updated successfully, but these errors were encountered:
mheinzerling
changed the title
Broken exception handing in org.glassfish.jersey.servlet.WebComponent#initContainerRequest since 2.44
Broken exception handling in org.glassfish.jersey.servlet.WebComponent#initContainerRequest since 2.44 (also in 3.1.9)
Oct 30, 2024
@jansupol , with d8f3e0f#diff-937cc5e5415a0412aa6850cc416fffb46747e443997e2d50b69162ba3af82b5c (#5669) you implemented an exception handling, that is not working as intended. This was a fix for #4867 . Let me first walk you through the issue.
You updated org.glassfish.jersey.servlet.WebComponent#initContainerRequest from (2.43):
to (2.44):
In case of an
IOException
on callinggetInputStream
initContainerRequest
failed right away with the sameIOException
in 2.43.After this change the
getInputStream
is not called at all ininitContainerRequest
and everything is fine for now.Nevertheless, at the first call on the EntityStream e.g.:
requestContext.getEntityStream().available()
the call will fail with yourUncheckedIOException
. But at this point in time we long left the try-catch-block and theUncheckedIOException
is being propagated through the system.Please check mheinzerling@1473d8d for a simple test demonstrating the old behavior.
And mheinzerling@7a677ee is showing the new behavior.
In both cases I just extracted a static method to reduce the test setup and the
mock*Request
methods are also identical.As mentioned above, I don't know what you tried to achieve with this change, so I can't recommend a fix. But at least in our system, I didn't notice any issue in just rolling back this snippet.
The same issue exists in 3.1.9.
Related to #5739
Please don't hesitate to send me a message if there are further questions. Thanks.
The text was updated successfully, but these errors were encountered: