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

Fastboot hangs + memory leak when an iframe image returns html #192

Open
Redsandro opened this issue Aug 24, 2018 · 1 comment
Open

Fastboot hangs + memory leak when an iframe image returns html #192

Redsandro opened this issue Aug 24, 2018 · 1 comment
Labels

Comments

@Redsandro
Copy link

  • fastboot-app-server version "1.1.0"

I think I finally figured out where this memory leak came from.

It seems that when pages are served with an iframe containing an external image, this image is loaded client side.

However, when this image returns html (as many servers do: redirect the image to a "404" page), fastboot will wait indefinitely for the response until Nginx finally gives up with the following error:

502 Bad Gateway
nginx/1.10.2

or

504 Gateway Time-out
nginx/1.10.2

nginx/error.log entry:

2018/08/23 23:02:01 [error] 4790#0: *627 upstream timed out (110: Connection timed out) while reading response header from upstream, client: xx.xx.xx.xx, server: www.example.com, request: "GET /category/5678 HTTP/1.1", upstream: "http://127.0.0.1:1234/category/5678", host: "www.example.com"

I can probably write some kind of workaround using if ember.fastboot do not render iframe, but I think it makes sense to bring this up here first.

Should fastboot be waiting on iframe contents? Is that even possible with all the security headers? What are the implications of fastboot executing all the iframe untrusted remote scripts, or why else is it waiting?

When manually visiting the "image", the 404 page displays without problems.

When a crawler visits this fastboot server, I get a ton of these error messages and the server memory is zero within the hour.

@Redsandro
Copy link
Author

Update

  1. While it is true that this happens with some pictures, they are not necessarily returning HTML.
  2. This does not happen with fastboot-cli, only with fastboot-server.
  3. It seems that a random number of pictures in iframe cause fastboot to hang, but it keeps happening with the same pictures.

@xg-wang xg-wang added the bug label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants