Skip to content

fix: clarify why @validator decorator cannot be used in sendfile example#3535

Open
digital-wizard48 wants to merge 1 commit intobenoitc:masterfrom
digital-wizard48:fix/issue-2279-sendfile-example-does-not-use
Open

fix: clarify why @validator decorator cannot be used in sendfile example#3535
digital-wizard48 wants to merge 1 commit intobenoitc:masterfrom
digital-wizard48:fix/issue-2279-sendfile-example-does-not-use

Conversation

@digital-wizard48
Copy link
Copy Markdown

Summary

  • The sendfile.py example had @validator commented out with only # breaks sendfile as explanation
  • The root cause is that wsgiref.validate.validator wraps the return value of the app in another iterable, so the isinstance(respiter, environ['wsgi.file_wrapper']) check in the sync worker fails
  • When that check fails, gunicorn falls back to iterating the response normally instead of using the sendfile syscall optimization
  • This PR improves the comment to clearly explain why @validator cannot be used with the sendfile example

Fixes #2279


This PR was auto-generated by Gittensor bot using Claude AI to fix a reported issue.

@benoitc
Copy link
Copy Markdown
Owner

benoitc commented Mar 13, 2026

why did you remove the @validator decoration though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sendfile example does not use sendfile

3 participants