Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is cache-money threadsafe? #24

Open
bpardee opened this issue Jun 18, 2010 · 5 comments
Open

Is cache-money threadsafe? #24

bpardee opened this issue Jun 18, 2010 · 5 comments

Comments

@bpardee
Copy link

bpardee commented Jun 18, 2010

I ask because we're converting an MRI app to JRuby and I got the following error which looks like a possible race condition:

undefined method pop' for <MemCache: 1 servers, ns: nil, ro: false>:MemCache [RAILS_ROOT]/vendor/gems/nkallen-cache-money-0.2.5/lib/cash/local.rb:17:inmethod_missing'

RAILS_ROOT]/vendor/gems/nkallen-cache-money-0.2.5/lib/cash/local.rb:17:in method_missing' [RAILS_ROOT]/vendor/gems/nkallen-cache-money-0.2.5/lib/cash/transactional.rb:39:inend_transaction'
[RAILS_ROOT]/vendor/gems/nkallen-cache-money-0.2.5/lib/cash/transactional.rb:19:in transaction' [RAILS_ROOT]/vendor/gems/nkallen-cache-money-0.2.5/lib/cache_money.rb:58:intransaction_with_cache_transaction'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in with_transaction_returning_status' [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:196:insave_with_transactions'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in rollback_active_record_state!' [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/transactions.rb:196:insave_with_transactions'
[RAILS_ROOT]/vendor/plugins/active_scaffold/lib/extensions/unsaved_record.rb:15:in `save_with_unsaved_flag'

It looks like an extra end_transaction was called without a matching begin_transaction?

@d01
Copy link

d01 commented Nov 26, 2011

Sorry to bump this musty bug, but we are in the same boat with a different error - bpardee, did you ultimately have to ditch cache_money in your JRuby move?

@bpardee
Copy link
Author

bpardee commented Nov 27, 2011

Yes, we no longer use it.

On Sat, Nov 26, 2011 at 3:43 PM, d01 <
[email protected]

wrote:

Sorry to bump this musty bug, but we are in the same boat with a different
error - bpardee, did you ultimately have to ditch cache_money in your JRuby
move?


Reply to this email directly or view it on GitHub:
#24 (comment)

@d01
Copy link

d01 commented Nov 27, 2011

If you don't mind my asking, was it that you definitely found it wasn't threadsafe? What did you switch to?

@bpardee
Copy link
Author

bpardee commented Nov 27, 2011

I can't remember if we definitively found that it wasn't threadsafe but
their definitely seemed to be a problem. We moved towards explicit
memcached client calls where we felt we needed them and put more thought
into what we were caching. For instance instead of caching all the
individual rows of data about a client we would cache it in one call since
they typically would load all that data anyways.

On Sat, Nov 26, 2011 at 9:09 PM, d01 <
[email protected]

wrote:

If you don't mind my asking, was it that you definitely found it wasn't
threadsafe? What did you switch to?


Reply to this email directly or view it on GitHub:
#24 (comment)

@d01
Copy link

d01 commented Nov 27, 2011

Thank you.

It's not good news in the short run, but I will be relieved to be ditching cache_money. It does appear to have worked, but it's one of the least documented, least maintained things I've ever been foolish enough to put into production, and it's just as well that I finally have to rip the bandaid off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants