orslumen/record-cache — Issue #13: a possible conflict with dalli
Author: thawatchai
Created: 2012-01-25 12:46:29+00:00
State: open

Thank you very much for this great gem. We've recently upgraded our site from Rails 2.3 to 3.1, and we use record-cache with success. We've deployed the new site for a couple days and it runs well so far. Our site has about 100k page views a day. It runs on heroku and use elasticache.

However, today we've found out an issue in development. When we use dalli, we see the following error. When we switch to memcache-client, it runs fine. The strange thing is that we use dalli on our production site and it has no problem.

Could you please help us on this issue? Thank you very much.

Thawatchai

-----------------------

RuntimeError in HomesController#show

can't modify frozen string
Rails.root: /Users/piyawat/workspace/kv

Application Trace | Framework Trace | Full Trace
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:152:in `force_encoding'
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:152:in `escape_key'
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:53:in `block in read_multi'
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:53:in `each'
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:53:in `inject'
dalli (1.1.4) lib/active_support/cache/dalli_store.rb:53:in `read_multi'
record-cache (0.1.2) lib/record_cache/version_store.rb:21:in `current_multi'
record-cache (0.1.2) lib/record_cache/strategy/id_cache.rb:36:in `fetch_records'
record-cache (0.1.2) lib/record_cache/strategy/base.rb:14:in `fetch'
record-cache (0.1.2) lib/record_cache/dispatcher.rb:76:in `fetch_from_first_cacheable_strategy'
record-cache (0.1.2) lib/record_cache/dispatcher.rb:44:in `block in fetch'
record-cache (0.1.2) lib/record_cache/strategy/request_cache.rb:35:in `fetch'
record-cache (0.1.2) lib/record_cache/dispatcher.rb:44:in `fetch'
record-cache (0.1.2) lib/record_cache/datastore/active_record_31.rb:43:in `find_by_sql_with_record_cache'
newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:491:in `block in find_by_sql_with_trace_ActiveRecord_self_name_find_by_sql'
newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:486:in `find_by_sql_with_trace_ActiveRecord_self_name_find_by_sql'
activerecord (3.1.3) lib/active_record/relation.rb:111:in `to_a'
activerecord (3.1.3) lib/active_record/relation/finder_methods.rb:376:in `find_first'
activerecord (3.1.3) lib/active_record/relation/finder_methods.rb:122:in `first'
activerecord (3.1.3) lib/active_record/relation/finder_methods.rb:263:in `find_by_attributes'
activerecord (3.1.3) lib/active_record/base.rb:1063:in `method_missing'
app/models/site.rb:17:in `current_site'
app/controllers/application_controller.rb:59:in `prepare_main_variables'
activesupport (3.1.3) lib/active_support/callbacks.rb:421:in `_run__1383835407183373441__process_action__2778667358124950038__callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `block in instrument'
activesupport (3.1.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
activerecord (3.1.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in `block in perform_action_with_newrelic_trace'
newrelic_rpm (3.3.1) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:250:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.3.1) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.1.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.3) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal.rb:236:in `block in action'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:82:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:532:in `call'
newrelic_rpm (3.3.1) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
exceptional (2.0.32) lib/exceptional/integration/rack_rails.rb:13:in `call'
rakismet (1.1.2) lib/rakismet/middleware.rb:10:in `call'
sass (3.1.12) lib/sass/plugin/rack.rb:54:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.6) lib/rack/etag.rb:23:in `call'
rack (1.3.6) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/flash.rb:247:in `call'
rack (1.3.6) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.6) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.3) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.3) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.6) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.6) lib/rack/lock.rb:15:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/static.rb:53:in `call'
rack-cache (1.1) lib/rack/cache/context.rb:132:in `forward'
rack-cache (1.1) lib/rack/cache/context.rb:241:in `fetch'
rack-cache (1.1) lib/rack/cache/context.rb:181:in `lookup'
rack-cache (1.1) lib/rack/cache/context.rb:65:in `call!'
rack-cache (1.1) lib/rack/cache/context.rb:50:in `call'
railties (3.1.3) lib/rails/engine.rb:456:in `call'
rack (1.3.6) lib/rack/content_length.rb:14:in `call'
railties (3.1.3) lib/rails/rack/log_tailer.rb:14:in `call'
thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.3.1) lib/thin/connection.rb:78:in `catch'
thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.3.1) lib/thin/connection.rb:53:in `process'
thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
thin (1.3.1) lib/thin/server.rb:159:in `start'
rack (1.3.6) lib/rack/handler/thin.rb:13:in `run'
rack (1.3.6) lib/rack/server.rb:265:in `start'
railties (3.1.3) lib/rails/commands/server.rb:70:in `start'
railties (3.1.3) lib/rails/commands.rb:54:in `block in '
railties (3.1.3) lib/rails/commands.rb:49:in `tap'
railties (3.1.3) lib/rails/commands.rb:49:in `'
script/rails:6:in `require'
script/rails:6:in `

'