ember-fastboot / ember-fastboot/fastboot

Fastboot hangs + memory leak when an iframe image returns html

Open
#192 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
155
Forks
67
PR merge metrics
No merged PRs in 30d

Description

* `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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.