-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Resteasy Reactive Rest Client fails to re-construct large chunks of streamed json (stream+json) and fails deserialization #30044
Comments
/cc @FroMage(resteasy-reactive), @Sgitario(rest-client), @cescoffier(rest-client), @geoand(rest-client,resteasy-reactive), @stuartwdouglas(resteasy-reactive) |
The previous behavior generated a corrupted payload when the frame was cut in the middle of the JSON object. This new simple parser accumulates correctly. Fix quarkusio#30044
Thank you for the report and the very nice reproducer. #30255 contains the fix. |
Thank you! |
The previous behavior generated a corrupted payload when the frame was cut in the middle of the JSON object. This new simple parser accumulates correctly. Fix quarkusio#30044 (cherry picked from commit e7eeaea)
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `2.15.2.Final` -> `2.15.3.Final` | | [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `2.15.2.Final` -> `2.15.3.Final` | --- ### Release Notes <details> <summary>quarkusio/quarkus</summary> ### [`v2.15.3.Final`](https://github.com/quarkusio/quarkus/releases/tag/2.15.3.Final) [Compare Source](quarkusio/quarkus@2.15.2.Final...2.15.3.Final) ##### Complete changelog - [#​30255](quarkusio/quarkus#30255) - Introduce a JSON Stream parser for the reactive rest client - [#​30242](quarkusio/quarkus#30242) - Throw an IllegalStateException with basic info about the provider that failed to provide a resource - [#​30227](quarkusio/quarkus#30227) - SmallRye GraphQL 1.9.1/2.0.1 + config property to control Federation - [#​30218](quarkusio/quarkus#30218) - OIDC documentation fixes - [#​30200](quarkusio/quarkus#30200) - Ensure that Kotlin implementation of QuarkusApplication works properly - [#​30195](quarkusio/quarkus#30195) - Log graphql.execution.AbortExecutionException when it occurs - [#​30190](quarkusio/quarkus#30190) - 2.15.2.Final breaks command mode with main class extends from QuarkusApplication in kotlin - [#​30187](quarkusio/quarkus#30187) - Bump xstream from 1.4.19 to 1.4.20 - [#​30183](quarkusio/quarkus#30183) - Fixing typos in security overview doc - [#​30177](quarkusio/quarkus#30177) - Properly handle SSE comments in RESTEasy Reactive client and server code - [#​30172](quarkusio/quarkus#30172) - Codestarts - Fix flattening of log levels - [#​30169](quarkusio/quarkus#30169) - NullPointerException when sending SSE with comment only - [#​30161](quarkusio/quarkus#30161) - Align behavior for getDeferredIdentity and getIdentity in TestIdentityAssociation - [#​30160](quarkusio/quarkus#30160) - Different behavior in TestIdentityAssociation for getDeferredIdentity and getIdentity - [#​30157](quarkusio/quarkus#30157) - Gradle quarkusDev: don't use test classes dir for app classes - [#​30155](quarkusio/quarkus#30155) - Show how to verify smallrye-jwt issuer in a shared network - [#​30154](quarkusio/quarkus#30154) - Remove remaining references to javax classes - [#​30152](quarkusio/quarkus#30152) - Improve error handling of AbortExecutionException in smallrye-graphql extension - [#​30146](quarkusio/quarkus#30146) - Properly segregate Json MessageBodyReader/Writer classes for server and client - [#​30145](quarkusio/quarkus#30145) - GraphQL federation directives, which allow multiple values, do not match Apollo contract - [#​30142](quarkusio/quarkus#30142) - When disabling name and version for label selectod in k8s, don't remove from labels - [#​30138](quarkusio/quarkus#30138) - Keycloak Dev Services - [#​30132](quarkusio/quarkus#30132) - Register REST Client body parameters for reflection - [#​30119](quarkusio/quarkus#30119) - Enable/disable GraphQL Federation automatically (+ add a config property for it) - [#​30100](quarkusio/quarkus#30100) - Setting `add-version-to-label-selectors: false` removes the app.kubernetes.io/version label - [#​30078](quarkusio/quarkus#30078) - Quarkus Kotlin Native Reactive REST Client not working properly - [#​30061](quarkusio/quarkus#30061) - Adding Kotlin Tests Breaks Kotlin/Java project - [#​30044](quarkusio/quarkus#30044) - Resteasy Reactive Rest Client fails to re-construct large chunks of streamed json (stream+json) and fails deserialization - [#​29998](quarkusio/quarkus#29998) - Bump to smallrye-config 2.13.1 - [#​29918](quarkusio/quarkus#29918) - smallrye-config: Converter<Int> throws IllegalStateException - [#​29609](quarkusio/quarkus#29609) - Remove Reflection replacements, now supported by GraalVM </details> <details> <summary>quarkusio/quarkus-platform</summary> ### [`v2.15.3.Final`](quarkusio/quarkus-platform@2.15.2.Final...2.15.3.Final) [Compare Source](quarkusio/quarkus-platform@2.15.2.Final...2.15.3.Final) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
The previous behavior generated a corrupted payload when the frame was cut in the middle of the JSON object. This new simple parser accumulates correctly. Fix quarkusio#30044
Describe the bug
Note: This is related to #30040 in that both result in
JsonMappingException
s, but this is a different issue.I am trying to use
RestMediaType.APPLICATION_STREAM_JSON
to stream aMulti
that contains a few larger objects (think ~25 kB each) from my reactive java server to a reactive java client, using the rest client.However, the deserialization of the objects fails with
Unexpected end-of-input
errors, either at the end of1943
bytes or8192
bytes. (For the1943
case, I think there is potentially header info on the first chunk that is cutting into the8192
total, since when I try to collect the chunks as Strings instead of reading them as my custom objects, all but the first String are 8192 chars long)Through my own investigation I have found the workaround is to increase the Vertx
HttpClientOptions
forDEFAULT_MAX_CHUNK_SIZE
andDEFAULT_RECEIVE_BUFFER_SIZE
, both of which are defaulted to8192
Maybe that is the final solution, but I would think that the rest client should be able to use the newline-delimited json to determine when it has received an entire object, and buffer/hold in memory up to that point before attempting to deserialize.
Expected behavior
Rest client can properly receive and deserialize a stream of larger json objects, without having to fiddle with the http client options myself
Actual behavior
Errors in the client:
How to Reproduce?
Reproducer:
service3
(client) andservice4
(server) in https://github.com/fleckware/quarkus-test./gradlew service4:quarkusDev
./gradlew service3:quarkusDev
curl localhost:8081/service4/test/large > output.json
curl localhost:8080/service3/test/large
service3
terminalOutput of
uname -a
orver
No response
Output of
java -version
openjdk 11.0.10
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.15.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle 7.4.2
Additional information
No response
The text was updated successfully, but these errors were encountered: