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

Streaming data via AJP causes OOME #1787

Closed
arinban opened this issue Jun 28, 2015 · 15 comments
Closed

Streaming data via AJP causes OOME #1787

arinban opened this issue Jun 28, 2015 · 15 comments

Comments

@arinban
Copy link

arinban commented Jun 28, 2015

Streaming data via AJP without setting a Content-Length header results in the data accumulating in-memory resulting in an eventual OutOfMemoryError.

See payara/Payara#350 for detailed diagnostics and reproducer

Affected Versions

[2.3.19]

@arinban
Copy link
Author

arinban commented Jun 28, 2015

@glassfishrobot Commented
Reported by payara_steve

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
@rlubke said:
Thanks for raising this. I'll take a look this week.

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
@rlubke said:
Able to reproduce. Investigating.

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
@rlubke said:
Root cause is that the AjpHttpResponse implementation doesn't take chunking configuration into account at all, so that code path is disabled. This means that the response has to be buffered in order to provide a content-length.

I've made a quick change to the aforementioned mentioned class and it appears to have resolved the problem.

We can provide a drop-in replacement JAR for the Grizzly runtime within GlassFish for you to test/confirm with in your environment, but we'll need to know what version of GlassFish you're using.

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
payara_steve said:
We are using Payara 4.1.152.1 which is based off GlassFish 4.1 but ships with Grizzly 2.3.19. I can test a patched Grizzly 2.3.19.

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
@rlubke said:
Modified 2.3.19 AJP code to resolve chunking issue.

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
File: grizzly-http-ajp-2.3.19.jar
Attached By: @rlubke

@arinban
Copy link
Author

arinban commented Jun 29, 2015

@glassfishrobot Commented
@rlubke said:
I've attached a modified 2.3.19 AJP jar.

You should be able to replace the existing 2.3.19 jar in your local maven repo and re-build your custom GF server to pick the JAR up.

@arinban
Copy link
Author

arinban commented Jun 30, 2015

@glassfishrobot Commented
payara_steve said:
Thanks I'll test the patch. Do you know which Grizzly release it will appear in if everything is OK?

BTW your repo synch to github seems to have stopped https://github.com/GrizzlyNIO/grizzly-mirror

@arinban
Copy link
Author

arinban commented Jun 30, 2015

@glassfishrobot Commented
@rlubke said:
The next release version is 2.3.22. I'll have to check with the team regarding a release timeline.

As to the mirror, you're right. Thanks for pointing that out. We'll look into it.

@arinban
Copy link
Author

arinban commented Jun 30, 2015

@glassfishrobot Commented
@rlubke said:
Unrelated to this issue, but the mirror issue is resolved.

@arinban
Copy link
Author

arinban commented Jun 30, 2015

@glassfishrobot Commented
@rlubke said:
2.3.x: 6c08805499f7c6b64c3c8806a71f0b58b52c960b
master: 102c432aa2004c581db1c297e94b0eb90dd74122

@arinban
Copy link
Author

arinban commented Jun 30, 2015

@glassfishrobot Commented
Marked as fixed on Tuesday, June 30th 2015, 9:34:42 am

@arinban arinban closed this as completed Jun 30, 2015
@arinban
Copy link
Author

arinban commented Apr 26, 2017

@glassfishrobot Commented
This issue was imported from java.net JIRA GRIZZLY-1787

@arinban
Copy link
Author

arinban commented Feb 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant