Skip to content

Fix uwsgi incomplete header error with async workers#3554

Merged
benoitc merged 1 commit intomasterfrom
fix/uwsgi-async-incomplete-header
Mar 24, 2026
Merged

Fix uwsgi incomplete header error with async workers#3554
benoitc merged 1 commit intomasterfrom
fix/uwsgi-async-incomplete-header

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented Mar 24, 2026

Fixes #3552

Use unreader.read(size) instead of unreader.read() to properly read exact bytes with gevent/gthread workers.

The _read_exact method was calling unreader.read() without a size
parameter, which only reads one chunk at a time. With gevent/gthread
workers, this could return incomplete data before the full header
arrived.

Use unreader.read(size) which has proper retry logic built-in to
read the exact number of bytes requested.

Fixes #3552
@benoitc benoitc merged commit 385a921 into master Mar 24, 2026
25 checks passed
@benoitc benoitc deleted the fix/uwsgi-async-incomplete-header branch March 24, 2026 22:17
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

Successfully merging this pull request may close these issues.

[Triage] [uwsgi] InvalidUWSGIHeader: incomplete header when using gevent or gthread workers

1 participant