Opened 5 years ago

Closed 5 years ago

#17286 closed Bug (fixed)

All cache backends need to call its 'close' function

Reported by: jifeng.yin@… Owned by: Grzegorz Nosek
Component: Core (Cache system) Version: master
Severity: Normal Keywords:
Cc: Zbigniew Siciarz Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django currently supports multiple cache backends. However, the only DEFAULT_CACHE will be closed when request is finished, just like before as the single CACHE_BACKEND setting.

Should we apply this logic to all the cache backends? Because several memcache backends are totally possible. Think in this user case: one for dramatic data -> shorter timeout, allow evictions; the other for static data -> longer timeout, do not allow evictions.

Please let me know your thought, thanks!

Attachments (1)

17286.diff (2.3 KB) - added by Grzegorz Nosek 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 5 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

Like all database connections are closed at the end of each request, all cache connections should be closed.

comment:2 Changed 5 years ago by Grzegorz Nosek

Owner: changed from nobody to Grzegorz Nosek
Status: newassigned

Changed 5 years ago by Grzegorz Nosek

Attachment: 17286.diff added

comment:3 Changed 5 years ago by Grzegorz Nosek

Has patch: set

comment:4 Changed 5 years ago by Zbigniew Siciarz

Cc: Zbigniew Siciarz added
Triage Stage: AcceptedReady for checkin

Works fine, RFC'd.

comment:5 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

In [17479]:

Fixed #17286 -- Made sure all cache backends are set up to connect to the signal handler that closes the cache connection when the request has been processed. Thanks, gnosek.

Note: See TracTickets for help on using tickets.
Back to Top