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

Issue: Cached metadata/generated files #158

Open
edward-simpson opened this issue Jan 10, 2022 · 7 comments
Open

Issue: Cached metadata/generated files #158

edward-simpson opened this issue Jan 10, 2022 · 7 comments

Comments

@edward-simpson
Copy link

I've been seeing an issue for a while now that I think relates to OPCache and generated metadata. It's not easy to replicate, but usually clears on subsequent deployments.

There are two scenarios I have seen:

  • Addition of new plugin, this plugin doesn't fire until after second deployment with no code changes.
  • Addition of new extension attributes - new attributes don't get added to generated class even after new deployment, causing site errors, solution has previously been to copy locally generated correct class onto server to replace cap generated file.

I think this is related to OPCaching of generated files, we use the cap opcache tool but this only clears opcache at the end of each deployment

@PascalBrouwers
Copy link

I also clear opcache at the end of each deployment. Never ran into any problems with it. Are you sure you are clearing cli AND web opcache?

@edward-simpson
Copy link
Author

edward-simpson commented Sep 12, 2022

@PascalBrouwers we flush the web opcache using scripts provided by our (magento specialist) hosting, cli opcache clears after each cli command finishes running, so flushing it manually isn't ever necessary

@PascalBrouwers
Copy link

hmm, are you maybe caching the backend with Redis and not using a different cache prefix on your deployment?

@edward-simpson
Copy link
Author

@PascalBrouwers interesting suggestion, how do you go about doing this? Doesn't look like there's a documented way of changing the id_prefix by CLI, unless you set it up as an env var?

@PascalBrouwers
Copy link

See #151 (comment) how I do it using capistrano.

@edward-simpson
Copy link
Author

@PascalBrouwers interesting thanks, could changing the cache key stop old entries from being flushed + cause Redis (or whatever caching system is being used) to fill up?

@PascalBrouwers
Copy link

That's you redis configuration. I suggest using an eviction policy of allkeys-lru or allkeys-lfu.

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