benoitc/gunicorn

sendfile example does not use sendfile

クローズ

#2,279 opened on 2020/02/27

 (4 件のコメント) (0 件のリアクション) (1 人の担当者)Python (1,707 件のフォーク)batch import
To Schedulegood first issue

Repository metrics

Stars
 (9,334 個のスター)
PR merge metrics
 (平均マージ 8h 8m) (30d で 1 merged PR)

説明

The sendfile example application does not actually result in a call to sendfile. I verified this by adding code to http/wsgi.py and also looking at the output of strace.

It works if I remove the @validator decorator on the app method in sendfile.py.

I guess this is because the worker is checking for an instance of the write type, but the type is not the same with the validator wrapper. workers/sync.py handle_request() says

if isinstance(respiter, environ['wsgi.file_wrapper']):

コントリビューターガイド