Use case: you add a big content to `messages.success`, bigger than what
your configured cache backend can accept (e.g. obtaining a TooBig error
with memcache). Then every future request from that session will crash.
I would suggest to log the failure instead of letting the cache backend
exception crash the request, and continue with the request, as missing
saving the session data in the cache is not a serious condition, it will
only slow the requests a bit as the database will be hit each time until
the issue is solved.
--
Ticket URL: <https://code.djangoproject.com/ticket/34806>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Thanks Claude for the report.
Following the description, I agree that it makes sense to not fail the
whole request when the storing in the cache fails. I couldn't find an
older ticket for this issue, so I'm accepting it, though it would be great
if you could provide a reproducer or test case to aid future contributors.
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:1>
* owner: nobody => Sulabh Katila
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:2>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
* needs_docs: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:3>
* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:4>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:5>
Comment (by Natalia Bidart):
Replied to PR questions and made an initial review, left comments.
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:6>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34806#comment:7>