Repository navigation
Send a buffer to the file service in pieces - #201
Merged
splitbrain merged 1 commit intoDec 3, 2026
Merged
Conversation
An attachment upload failed with "Internal error" when the user attached two files to one prompt and one of them was larger than about 10 MiB. The orchestrator gave each buffer to the HTTP/2 session of the box as a whole. Node.js limits the memory of a session to 10 MB by default, and the session refused each new request while a larger buffer waited in it. The dashboard uploads the attachments of a prompt in parallel, so a request for the other file was refused. The orchestrator now sends a buffer in pieces of 64 KiB and waits when the session is full.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An attachment upload failed with
Internal errorwhen the user attached two files to one prompt and one of them was larger than about 10 MiB. The prompt was then not sent. A second try worked, because the composer uploaded only the failed file again.Cause: The orchestrator uses one HTTP/2 session for each box and gave each buffer body to it as a whole. Node.js limits the memory of a session to 10 MB by default. While a larger buffer waited in the session, the session refused each new request with
NGHTTP2_ENHANCE_YOUR_CALM. The dashboard uploads the attachments of a prompt in parallel, so a request for the other file was refused. The error handler reported the refusal as a 500.Changes:
FileService.sendsends a buffer body in pieces of 64 KiB and waits when the session is full. This applies to each request with a buffer body, not only to attachments.Limits:
Tests:
files.test.tschecks that a 1 MiB file is stored while a 14 MiB file is sent on the same connection. The test failed in each run before the change.