Shopify / Shopify/identity_cache
Add a warning in the README and code about the fallback fetcher
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2k
- Forks
- 174
- Avg merge
- 13m
- Merged PRs (30d)
- 3
Description
As mentioned in https://github.com/Shopify/identity_cache/issues/268#issuecomment-250588856
It looks like we are missing a warning about this in the README and the code. The README even uses ActiveSupport::Cache::MemCacheStore as an example for configuring identity cache, which doesn't
.respond_to?(:cas)or.respond_to?(:cas_multi)so it will use the fallback fetcher. Having a warning if the fallback fetcher is used would make this mis-configuration easier to catch and make it easier to discover this problem when upgrading.
Otherwise, users will run into issues like https://github.com/Shopify/identity_cache/issues/268 about cache corruption, even though this is a known problem.
We might want to mention other pitfalls about caching like how memcache clients normally fallback to use a different server for a cache key, which can cause an invalidation to go to the wrong server without noticing. I remember that we configured memcache to not do this. It is still possible that cache invalidation could get missed because of connection errors with sending invalidation operations to memcached, but that could at least be reduced by not falling back to another server.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the README's ActiveSupport::Cache::MemCacheStore example and locate the code path that selects the fallback fetcher. Confirm how fallback use is detected, then add the requested warning in the code and document the configuration risk in the README; done means both surfaces clearly identify the misconfiguration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- memcached, ruby
- Domain
- backend, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100