Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] Don't silently discard exceptions when getting/setting session via memcache

#6113

It's not clear to me why the code should 'rescue MemCache::MemCacheError, Errno::ECONNREFUSED' silently in the get_session and set_session methods returning {} and true respectively. Even if the higher level is to handle a false returned from set_session, how will it know what to do with no context?

In my case, I had a > 1 MB value being stored in memcache that was silently failing on the set_session in one location and then the get_session came back nil on retrieving it a few seconds later, leaving me thoroughly confused. I had turned up memcached -vv tracing and could see the "set" never occurring and finally found the following:

This was originally fixed back in 2007 in this commit:

commit d0df7f2b12b201edbef0d59360224e68f9a0a447
Author: Jeremy Kemper jeremy@bitsweat.net
Date: Sun Oct 14 20:46:06 2007 +0000

Memcached sessions: add session data on initialization; don't silently discard exceptions; add unit tests. Closes [#9823](/projects/8994/tickets/9823 "Ticket #9823").

and was broken in this commit:

commit ed708307137c811d14e5fd2cb4ea550add381a82
Author: Joshua Peek josh@joshpeek.com
Date: Mon Dec 15 16:33:31 2008 -0600

Switch to Rack based session stores.

Attached is a patch with test for the set_session > 1 MB.

Reported by Joe Rafaniello · December 3rd, 2010 @ 07:33 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Joe Rafaniello
    Joe Rafaniello
    • Tag changed from 2.3.x 2.3.10 to 2.3.x 2.3.10, memcachestore

    December 3rd, 2010 @ 07:34 PM

  2. rails
    rails
    • Tag changed from 2.3.x 2.3.10, memcachestore to 23x 2310, memcachestore
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    March 4th, 2011 @ 12:00 AM

  3. rails
    rails
    • State changed from open to stale

    March 4th, 2011 @ 12:00 AM