Opened 3 years ago

Last modified 17 months ago

#16358 assigned Bug

cached_db session with memcached forgets big values

Reported by: ccrisan Owned by: anonymous
Component: Core (Cache system) Version: master
Severity: Normal Keywords: session cache memcached
Cc: ccrisan Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no


Considering memcached's 1MB limit, putting a value larger than 1MB into a cached_db session will get written to DB but not to cache. However a previous value for the session key already exists in the cache, and thus the session gets restored with previous data from the cache, instead of the new information stored in django_session table, in the DB.
My guess is that the memcached backed should remove the key when not being able to set it to the new value.

Attachments (1) (640 bytes) - added by ccrisan 3 years ago.
patch for that makes the backend clear a key if unable to set it

Download all attachments as: .zip

Change History (6)

comment:1 Changed 3 years ago by ccrisan

  • Cc ccrisan added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by manfre

  • Owner changed from nobody to anonymous
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

Changed 3 years ago by ccrisan

patch for that makes the backend clear a key if unable to set it

comment:3 Changed 3 years ago by ccrisan

  • Has patch set

I've attached a small simple patch for I'm not sure if this is the right thing to to in this case. What should be a cache's behavior in case of failure to set a key, anyways?

comment:4 Changed 3 years ago by adamnelson

  • Needs tests set
  • Patch needs improvement set
  • Version changed from 1.3 to SVN

comment:5 Changed 17 months ago by aaugustin

This makes sense, could you:

  • add a test case in tests/regressiontests/cache/
  • generate a single patch from the root of the Django repository (or make a pull request)?

Add Comment

Modify Ticket

Change Properties
<Author field>
as assigned
Next status will be 'assigned'
The ticket will be disowned. Next status will be 'new'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.