Changes between Initial Version and Version 1 of Ticket #34865, comment 17
- Timestamp:
- Feb 8, 2025, 8:09:15 AM (4 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #34865, comment 17
initial v1 1 1 Thinking more about this ticket (please note that I am thinking out loud here, so let me know if take a wrong turn somewhere): `DatabaseWrapper` is in a standard setup *not* supposed to get garbage collected at all. Each thread will have one wrapper per defined database stored in a thread local (`ConnectionHandler`/`BaseConnectionHandler`). So unless the "web"server is spawning a new thread per connection this should not be a problem (I could see it being a problem for runserver but that is for dev only anyways). 2 2 3 So to the people having issues here: Where exactly are you seeing this, in job queues (celery etc) or in your webservers (which exactly). Fábio mentioned seeing it on uvicorn / daphne, is this also a problem for gunicorn (I know that one usually has a fixed worker & thread count there) .3 So to the people having issues here: Where exactly are you seeing this, in job queues (celery etc) or in your webservers (which exactly). Fábio mentioned seeing it on uvicorn / daphne, is this also a problem for gunicorn (I know that one usually has a fixed worker & thread count there)? 4 4 5 5 Please note that I am not saying that there is no problem hidden here, the cyclic reference is certainly ugly. But if the object isn't ment to get garbage collected, it is not the end of the world. That said I would certainly prefer a solution that doesn't use a weakref proxy (we would need to do some profiling on the overhead).