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

Media support (such as Path) in Níma HTTP1 buffer into memory #7006

Closed
Verdent opened this issue Jun 15, 2023 · 0 comments
Closed

Media support (such as Path) in Níma HTTP1 buffer into memory #7006

Verdent opened this issue Jun 15, 2023 · 0 comments
Assignees
Labels
4.x Version 4.x bug Something isn't working design This issue requires design/architecture decisions must-have Níma Helidon Níma P3 webclient
Milestone

Comments

@Verdent
Copy link
Member

Verdent commented Jun 15, 2023

Media support in Níma HTTP1 currently does not work properly.
HttpCallEntityChain buffers everything into the memory, instead of writing into the request OS. It should rather use something similar to ClientConnectionOutputStream which performs sent entity analysis to determine proper transfer-encoding and content-length.

Once this is changed, it will break our current redirect support for entities introduced in #6804. Once the following issue is fixed #6992, it should introduce fix usable also by this issue.

Tomas Langer:
For example when you call ServerResponse.send(Paths.get("/my/file.txt")) the file will be fully buffered into memory.

Possible solutions (there may be more):

  • have a boolean streaming() on media supports to tell the server and client that this really must be streamed and not cached in memory
  • have some advanced logic to buffer a certain (max) amount in memory for any provider, and if more bytes would be written, start sending them over the network

In both cases we need to refactor the method send(Object) on server response (and appropriate one on client request)

@Verdent Verdent added webclient 4.x Version 4.x Níma Helidon Níma labels Jun 15, 2023
@m0mus m0mus added the bug Something isn't working label Jun 15, 2023
@m0mus m0mus added this to the 4.0.0 milestone Jun 15, 2023
@tomas-langer tomas-langer changed the title Media support in Níma WebClient HTTP1 buffers everything into memory Media support (such as Path) in Níma HTTP1 buffer into memory Jun 15, 2023
@tomas-langer tomas-langer added the design This issue requires design/architecture decisions label Jun 15, 2023
@tomas-langer tomas-langer self-assigned this Aug 15, 2023
@tomas-langer tomas-langer modified the milestones: 4.0.0, 4.0.0-M2 Aug 17, 2023
@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working design This issue requires design/architecture decisions must-have Níma Helidon Níma P3 webclient
Projects
Archived in project
Development

No branches or pull requests

3 participants