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] Add a method to MemCacheStore to reset the connection to memcached

#2812

When you're using Phusion Passenger's smart spawning mode, file descriptors get shared between all of the new processes. This means that you have to close and re-open any persistent connections (such as memcached) that your Rails app has. If you are using Rails' integrated cache, this is difficult without either monkey-patching ActiveSupport::Cache::MemCacheStore or using instance_variable_get. I don't think either of those are clean solutions so I created this patch, which is literally three lines of code. I didn't include a test for the method because the stats and clear methods of MemCacheStore aren't tested either, and this one's along the same lines. Let me know if I missed anything!

Reported by Eric Entin · June 17th, 2009 @ 03:28 PM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Eric Entin
    Eric Entin
    • Tag set to cache, patch

    June 17th, 2009 @ 06:37 PM

  2. Lawrence Pit
  3. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  4. Dan Pickett
    Dan Pickett
    • Tag changed from cache, patch to bugmash, cache, patch

    May 9th, 2010 @ 07:26 PM

  5. Joel Watson
    Joel Watson
    • Importance changed from to

    +1

    Would be nice if we could get this backported to a 2.3.x release. It's pretty lame that you have to work around this by either monkeypatching MemCacheStore or doing some nasty hackery.

    July 18th, 2010 @ 02:35 AM

  6. Santiago Pastorino
    Santiago Pastorino

    Eric please add tests for this.

    July 19th, 2010 @ 05:14 PM

  7. Santiago Pastorino
    Santiago Pastorino
    • 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.

    February 2nd, 2011 @ 04:51 PM

  8. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:51 PM