Skip to content

[pull] main from django:main#504

Merged
pull[bot] merged 5 commits into
threatcode:mainfrom
django:main
Jul 23, 2026
Merged

[pull] main from django:main#504
pull[bot] merged 5 commits into
threatcode:mainfrom
django:main

Conversation

@pull

@pull pull Bot commented Jul 23, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

M0nd0R and others added 5 commits July 23, 2026 08:55
Error response handling frequently makes use of the database, and so
must use the request specific connection sensitive worker thread.

Previously response_for_exception was dispatched on the event loop's
default executor. This potentially leads to pool exhaustion, and
deadlock, when using database pooling option, or a large number of
permanently held open database connections when not using pooling.

Connections held open were not subject to cleanup. If closed server
side, the reported "connection is closed" would be seen until
application restart.

Moving error response rendering to the request specific connection
sensitive worker thread resolves both of these issues.

The `thread_sensitive=False` was set in
e17ee44 to maintain the prior
behaviour when asgiref switched the thread_sensitive default to
`True`. There was no specific reason for the non-tread-sensitive
behaviour beyond that. (With hindsight it was always incorrect for
the reasons here.)
Forwardport of ced2d11 from stable/6.1.x.
@pull pull Bot locked and limited conversation to collaborators Jul 23, 2026
@pull pull Bot added the ⤵️ pull label Jul 23, 2026
@pull
pull Bot merged commit 50c2b7c into threatcode:main Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants