Re: [Django] #35651: RedisCacheClient does not reuse connections from the connection pool

18 views
Skip to first unread message

Django

unread,
Aug 3, 2024, 10:50:25 PM8/3/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Peter
| Williams
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Peter Williams ):

* owner: (none) => Peter Williams
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 4, 2024, 2:33:43 PM8/4/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Peter
| Williams
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Ahmed Ibrahim):

I'm willing to help if needed
--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:7>

Django

unread,
Aug 6, 2024, 11:43:10 PM8/6/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Peter
| Williams
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Peter Williams ):

Replying to [comment:7 Ahmed Ibrahim]:
> I'm willing to help if needed
Ahmed, I haven't started on this ticket yet as a few things came up. I
will un-assign myself so you can assign it to yourself!
--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:8>

Django

unread,
Aug 6, 2024, 11:43:38 PM8/6/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+------------------------------------
Reporter: gojuukaze | Owner: (none)
Type: Bug | Status: new
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Peter Williams ):

* owner: Peter Williams => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:9>

Django

unread,
Aug 7, 2024, 2:58:09 PM8/7/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ankit Jhunjhunwala):

* owner: (none) => Ankit Jhunjhunwala
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:10>

Django

unread,
Aug 7, 2024, 3:19:16 PM8/7/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ankit Jhunjhunwala):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:11>

Django

unread,
Aug 8, 2024, 5:02:51 AM8/8/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_tests: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:12>

Django

unread,
Aug 9, 2024, 8:33:58 AM8/9/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:13>

Django

unread,
Sep 3, 2024, 3:48:01 AM9/3/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* cc: Jon Janzen (added)
* needs_better_patch: 0 => 1

Comment:

Copying
[https://github.com/django/django/pull/18459#pullrequestreview-2276655971
my comment from the PR], because I don't think the approach suggested
there is viable:

> I haven't had the chance to fully dig in and see what/why it's happening
but logging in BaseConnectionHandler.__getitem__() shows that we're not
correctly caching the connection instance. The expected behaviour there is
to create the instance on the first access, and then re-use it. That's not
happening.
>
> For some value of works, moving the pools to the class will work around
it, but not for the correct reason, AFAICS.
>
> The reproduce uses ASGI. Q: is this only happening in async code? I'm
imagining so because the connections storage is a Local, so we'll be
running into some thread sensitivity issue here: self._connections =
Local(self.thread_critical)
>
> More investigation needed.
--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:14>

Django

unread,
Sep 3, 2024, 3:49:05 AM9/3/24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+-------------------------------------
Reporter: gojuukaze | Owner: Ankit
| Jhunjhunwala
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi, async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* keywords: => asgi, async

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:15>

Django

unread,
Mar 24, 2025, 6:56:39 AMMar 24
to django-...@googlegroups.com
#35651: RedisCacheClient does not reuse connections from the connection pool
-------------------------------------+------------------------------------
Reporter: gojuukaze | Owner: Dingning
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi, async | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Dingning):

* owner: Ankit Jhunjhunwala => Dingning

--
Ticket URL: <https://code.djangoproject.com/ticket/35651#comment:16>
Reply all
Reply to author
Forward
0 new messages