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

instrumentation-remix: cloning incoming requests can lead to excessive memory usage #51

Open
abustany opened this issue Jun 24, 2024 · 0 comments

Comments

@abustany
Copy link

As we can see in

, incoming "action" requests are cloned so that some form attributes can be forwarded to span attributes. The cloning means that the entire request body gets buffered in memory, which can be problematic for example when uploading large files.

It feels that the code could clone the request only if those two conditions are met:

  • the content type is a form content type (so formData() returns something)
  • actionFormDataAttributes is set on the plugin config

the first point probably wouldn't help for directly large uploads (since multipart/form-data can still be decoded into a FormData), but the second would allow avoiding excessive memory usage where not needed?

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

1 participant