-
Notifications
You must be signed in to change notification settings - Fork 19
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
Handle streaming response errors #595
Conversation
The necessary update to |
http-server-jetty/src/test/groovy/io/micronaut/servlet/jetty/JettyErrorSpec.groovy
Outdated
Show resolved
Hide resolved
http-server-jetty/src/test/groovy/io/micronaut/servlet/jetty/JettyErrorSpec.groovy
Outdated
Show resolved
Hide resolved
http-server-undertow/src/test/groovy/io/micronaut/servlet/undertow/UndertowErrorSpec.groovy
Outdated
Show resolved
Hide resolved
http-server-undertow/src/test/groovy/io/micronaut/servlet/undertow/UndertowErrorSpec.groovy
Outdated
Show resolved
Hide resolved
|
||
then: | ||
HttpClientResponseException ex = thrown(HttpClientResponseException) | ||
ex.status == HttpStatus.OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 200 code expected for an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sdelamo Yes, because this is an odd case. As the error occurs during a chunked response, the status code has already been written and can't be changed. The only thing the server can do is just stop writing the data and end the response. The expected behavior being verified is that incomplete data is sent and thus the client exception happens when actually trying to deserialize the response.
http-server-tomcat/src/test/groovy/io/micronaut/servlet/tomcat/TomcatErrorSpec.groovy
Outdated
Show resolved
Hide resolved
http-server-tomcat/src/test/groovy/io/micronaut/servlet/tomcat/TomcatErrorSpec.groovy
Outdated
Show resolved
Hide resolved
…ettyErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
…ettyErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
…rtow/UndertowErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
…rtow/UndertowErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
…/TomcatErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
…/TomcatErrorSpec.groovy Co-authored-by: Sergio del Amo <[email protected]>
Please retry analysis of this Pull-Request directly on SonarCloud. |
Oh, hell @jeremyg484 I committed Sergios' suggested commits. I thought htis was my servlet PR. I need to pay more attention. Happy Friday.😛 |
@wetted All good, thanks for the help (even if unintentional)! ;) |
Kudos, SonarCloud Quality Gate passed! |
🥴 I left one of Sergio's questions unresolved for you to answer. |
Streaming reactive response body processing is updated to complete the response when an error signal is encountered.
This brings parity to the way streaming errors are handled in the Netty server implementation. Previously an error
signal resulted in the response hanging and never completing.
This mostly fixes the TCK test failures encountered when trying to update to Micronaut Core 4.1.11 (#588), but one of the
test methods in the TCK's
ErrorHandlerFluxTest
will need to be updated to detect the error properly withmid-stream errors and the way they get written to the servlet response.