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

Page not fully rendered (Compression + HTML builder) #708

Closed
gzoritchak opened this issue Nov 8, 2018 · 7 comments
Closed

Page not fully rendered (Compression + HTML builder) #708

gzoritchak opened this issue Nov 8, 2018 · 7 comments
Assignees

Comments

@gzoritchak
Copy link

I put brackets on Compress and HTML builder because I'm not completely sure of what is happening.

The problem appeared on some pages generated from markdown files through HTML builders. The MD files are parsed and transformed into HTML with a third party library. This HTML is then injected into HTML builders using an unsafe block. MD files, and by extension unsafe content, can be quite big.

When loading pages from a browser they often appear to be only partially rendered even though the HTTP code is 200.

My current intuition, after some debugging and with a partial knowledge of ktor internals, is that the bug comes from the combination of Compression feature and big html streams. At one moment, the html stream uses some BufferedWriter and the compression takes the content of buffer and ends the HTTP request even if the content as not complete the html generation.

@gzoritchak
Copy link
Author

I was able to reproduce this bug on Jetty and Netty.

@Bluexin
Copy link

Bluexin commented Nov 9, 2018

Might be the same cause as #685

@cy6erGn0m
Copy link
Contributor

Workarounded in 1.0.0-beta-4

@gzoritchak
Copy link
Author

Thanks @cy6erGn0m for this quick resolution.

You indicates the solution to be a workaround. Are there some limitations with this implementation?

@cy6erGn0m
Copy link
Contributor

This solution is not good enough due to performance impact (introduces scheduling delay)

@Bluexin
Copy link

Bluexin commented Nov 20, 2018

Is there an issue open for tracking updates for an actual definitive fix ? Seeing this is just a workaround (so it doesn't get forgotten)

@cy6erGn0m
Copy link
Contributor

cy6erGn0m commented Nov 20, 2018

@Bluexin See #742

schleinzer pushed a commit to schleinzer/ktor that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants