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

Ensure that VertxInputStream doesn't result in infinite attempts to read data #17546

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented May 31, 2021

This change is needed because Netty now calls available to determine
whether or not more bytes are available, before calling read.
The negative value that we used to use does not play well with
PushbackInputStream which is used by Netty to wrap the stream.
For a full description of how I can came to this, see
#17506 (comment)

Fixes: #17506

…ead data

This change is needed because Netty now calls available to determine
whether or not more bytes are available, before calling read.
The negative value that we used to use does not play well with
PushbackInputStream which is used by Netty to wrap the stream.
For a full description of how I can came to this, see
quarkusio#17506 (comment)

Fixes: quarkusio#17506
@geoand
Copy link
Contributor Author

geoand commented May 31, 2021

Also cc @vietj who might have a better idea about this

@stuartwdouglas
Copy link
Member

What is actually calling available() in our InputStream?

I don't really understand the code path where our InputStream ends up being used by Netty?

@geoand
Copy link
Contributor Author

geoand commented Jun 1, 2021

@stuartwdouglas see the comment I linked to (which contains a link to a Netty PR).
Basically Netty now calls available before calling read when using the ChunkedStream

@stuartwdouglas
Copy link
Member

How does Netty get our VertxInputStream? Netty does everything non blocking and this is a blocking class that we explose to the users application, so I am not sure how it gets passed down into Netty?

@geoand
Copy link
Contributor Author

geoand commented Jun 1, 2021

It likely only happens in the case of #17506 where the application is actually buffering the InputStream and using a library for HTTP calls (org.asynchttpclient:async-http-client) that used Netty under the hood

@stuartwdouglas stuartwdouglas merged commit fd90966 into quarkusio:main Jun 1, 2021
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 1, 2021
@geoand geoand deleted the #17506 branch June 1, 2021 06:33
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.CR3 Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resteasy Reactive: InputStream is closed too early
3 participants