Skip to content
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 Gzip max input with suffix format not working #39636

Closed
rennanfelizardo opened this issue Mar 22, 2024 · 8 comments · Fixed by #39828
Closed

Resteasy Gzip max input with suffix format not working #39636

rennanfelizardo opened this issue Mar 22, 2024 · 8 comments · Fixed by #39828
Labels
area/resteasy-classic kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.
Milestone

Comments

@rennanfelizardo
Copy link

rennanfelizardo commented Mar 22, 2024

Describe the bug

The documentation mentions that the quarkus.resteasy.gzip.max-input can be configured by providing a suffix format such as 100M.

This configuration option would recognize strings in this format (shown as a regular expression): `[0-9]+[KkMmGgTtPpEeZzYy]?`.
If no suffix is given, assume bytes.

If the property is configured using the allowed suffix (check regex above), Resteasy considers it as an invalid format and falls back to the default value of 10mb.

A log message can also be identified in the log output.

RESTEASY002137: Invalid format for resteasy.gzip.max.input, using default value 10000000

The properties used in quarkus tests do not use such suffix, considering only the bytes format.


In addition, Resteasy GZIPDecodingInterceptor only accepts a value up to 2147483647 (Integer.MAX_VALUE), which I think would worth mentioning in the documentation.
https://github.com/resteasy/resteasy/blob/6.2.7.Final/resteasy-core/src/main/java/org/jboss/resteasy/plugins/interceptors/GZIPDecodingInterceptor.java

Expected behavior

Quarkus should be able to properly convert the size if a data storage unit is provided as a suffix

OR

Consider only bytes format

Actual behavior

Quarkus is not able to convert the data storage unit falling back to the default value of 10mb

How to Reproduce?

quarks-gzip-reproducer.zip

Output of uname -a or ver

No response

Output of java -version

openjdk 17.0.9 2023-10-17 OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9) OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode)

Quarkus version or git rev

3.8.3

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Mar 22, 2024

What configuration value did you use to cause the error message?

Asking because I was not able to reproduce the problem.

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Mar 22, 2024
@rennanfelizardo
Copy link
Author

quarkus.resteasy.gzip.enabled=true
quarkus.resteasy.gzip.max-input=1k

quarkus.rest-client.my-client.url=http://localhost:${quarkus.http.test-port:8081}

The problem happens whenever you configure the max-input property with a data storage unit suffix.
[0-9]+[KkMmGgTtPpEeZzYy]?.

You can find the reproducer attached to the issue.

@geoand
Copy link
Contributor

geoand commented Mar 23, 2024

You can find the reproducer attached to the issue.

I tried the attached sample and could not reproduce the problem, which is why I asked :)

@rennanfelizardo
Copy link
Author

Thanks for your return.
I've implemented a test that reproduce the problem in the sample.
Could you kindly confirm if the test is not reproducing the issue? I just ran it and I confirm on my side.

@geoand
Copy link
Contributor

geoand commented Mar 23, 2024

Thanks.

I'm not at a computer now, I'll try it next week.

@geoand
Copy link
Contributor

geoand commented Mar 26, 2024

The tests pass in the uploaded reproducer.

@gsmet
Copy link
Member

gsmet commented Apr 2, 2024

@geoand the trick is that AFAICS the test is testing that the behavior is incorrect.

I think I have a fix, will push it soon.

gsmet added a commit to gsmet/quarkus that referenced this issue Apr 2, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636
@gsmet
Copy link
Member

gsmet commented Apr 2, 2024

#39828 should fix it.

Thanks for raising the issue as it was indeed concerning.

@quarkus-bot quarkus-bot bot added this to the 3.10 - main milestone Apr 2, 2024
@gsmet gsmet modified the milestones: 3.10 - main, 3.9.2 Apr 2, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Apr 2, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636

(cherry picked from commit bd4d294)
gsmet added a commit to gsmet/quarkus that referenced this issue Apr 3, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636

(cherry picked from commit bd4d294)
@gsmet gsmet modified the milestones: 3.9.2, 3.8.4 Apr 3, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue Apr 9, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636

(cherry picked from commit bd4d294)
@gsmet gsmet modified the milestones: 3.8.4, 3.9.2 Apr 11, 2024
ketola pushed a commit to ketola/quarkus that referenced this issue May 1, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636
@gsmet gsmet modified the milestones: 3.9.2, 3.8.5 May 15, 2024
gsmet added a commit to gsmet/quarkus that referenced this issue May 15, 2024
Some part of RESTEasy are using ResteasyConfigurationMPConfig to map the
config and we were incorrectly pushing the raw string for
quarkus.resteasy.gzip.max-input.

Fixes quarkusio#39636

(cherry picked from commit bd4d294)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-classic kind/bug Something isn't working triage/needs-feedback We are waiting for feedback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants