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

When fetch is used keepalive is the default, and Chrome only allows a POST body <= 65536 bytes in that scenario #1464

Closed
beaugunderson opened this issue Aug 6, 2018 · 4 comments

Comments

@beaugunderson
Copy link

beaugunderson commented Aug 6, 2018

What is the current behavior?

raven-js has keepalive: true in its fetchDefaults. Because of this, POSTs to Sentry using fetch will fail with a generic error if they are larger than 65536 bytes. This is smaller than Sentry's 100,000 byte limit (as I understand it). It's also smaller than the onpremise limits (which are set by uWSGI, as I understand it).

I opened this Chrome bug which helps explain further: https://bugs.chromium.org/p/chromium/issues/detail?id=871115&can=4&q=&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified

What is the expected behavior?

I expect raven-js to be able to POST messages >= 65536 without failing.

Secondarily, it would be nice if there was some logging for failed log messages (basically echoing the sentiments of the people in the 413/too large issue comments)!

Versions

raven-js: 3.24.2
macOS Chrome: 68.0.3440.84

@beaugunderson
Copy link
Author

If anyone needs a workaround:

Raven.config('<DSN>', {
  fetchParameters: {
    keepalive: false
  }
});

@beaugunderson
Copy link
Author

update: the 64kb limit is part of the fetch() spec when keepalive is true, so keepalive: true should probably not be the default, or the docs should be updated.

@kamilogorek
Copy link
Contributor

Thanks for the details. I'll look into this.

https://fetch.spec.whatwg.org/#http-network-or-cache-fetch point 8.5.

If the sum of contentLengthValue and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.

The above limit ensures that requests that are allowed to outlive the environment settings object and contain a body, have a bounded size and are not allowed to stay alive indefinitely.

@beaugunderson
Copy link
Author

thanks so much @kamilogorek! ✨

This was referenced Apr 21, 2020
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

2 participants