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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check MEMCACHE_SERVERS in connect to memchached server #34705

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@unasuke
Copy link
Contributor

unasuke commented Dec 14, 2018

Summary

Dalli uses ENV["MEMCACHE_SERVERS"] to default memchached server address when not any address passed in client.new .

But ActiveSupport uses localhost:11211 in ActiveSupport::Cache::MemCacheStoreTest.build_mem_cache called
without arguments.
Its behavior can't overwrite by environment variable "MEMCACHE_SERVERS".

If address passed, use this.
Else, check "MEMCACHE_SERVERS" then it has value, use this.
If neither, use nil to initialize Dalli::Client .

Other Information

I found this problem when run ActiveSupport test by memcached that running other host.

In my opinion, ActiveSupport has to respects to Dalli behavior to use MEMCACHE_SERVER environment variable. 馃槈

@rails-bot rails-bot bot added the activesupport label Dec 14, 2018

Check MEMCACHE_SERVERS in connect to memchached server
Dalli uses ENV["MEMCACHE_SERVERS"] to default memchached server address
when not any address passed in client.new .

But ActiveSupport uses localhost:11211 in
ActiveSupport::Cache::MemCacheStoreTest.build_mem_cache called
without arguments.
Its behavior can't overwrite by environment variable "MEMCACHE_SERVERS".

If address passed, use this.
Else, check "MEMCACHE_SERVERS" then it has value, use this.
If neither, use nil to initialize Dalli::Client.

@unasuke unasuke force-pushed the unasuke:memcached_host_address branch from 536310e to a22a744 Dec 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment