📝 Clarify async technical details in UploadFile documentation#15696
Open
achyutadixit wants to merge 1 commit into
Open
📝 Clarify async technical details in UploadFile documentation#15696achyutadixit wants to merge 1 commit into
async technical details in UploadFile documentation#15696achyutadixit wants to merge 1 commit into
Conversation
- Explain why threadpool is used (blocking file I/O needs to be non-blocking) - Clarify this maintains event loop concurrency - Remove misleading implication that all async operations use threadpool - Connect to the broader async/await philosophy of FastAPI
Contributor
📝 Docs previewLast commit 70fed28 at: https://e8589395.fastapitiangolo.pages.dev Modified Pages |
YuriiMotov
approved these changes
Jun 6, 2026
YuriiMotov
left a comment
Member
There was a problem hiding this comment.
I wouldn't say that current note text is "misleading" - for those who read docs in the order everything should be clear.
I think it just "can be a bit better".
But this edit makes sense to me.
Passing this to Sebastian for review
async technical details in UploadFile documentation
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.
Description
This PR clarifies the misleading "async Technical Details" note in the UploadFile documentation.
File:
docs/en/docs/tutorial/request-files.mdhttps://github.com/fastapi/fastapi/blob/master/docs/en/docs/tutorial/request-files.md
Current Issue
The current note states:
While technically accurate, this is misleading because:
Solution
The updated note now explains:
Technical Background
Evidence from source code (
fastapi/datastructures.py):Each async method has a docstring: "To be awaitable, compatible with async, this is run in threadpool."
Evidence from documentation (
docs/en/docs/async.md, line 418):FastAPI explicitly states threadpool is used for
deffunctions, implyingasync defshould NOT use threadpool except for blocking I/O (which requires special handling).New Text