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

Already on GitHub? Sign in to your account

Wrap ActionView cache expiry in a mutex #36323

Merged
merged 1 commit into from May 23, 2019

Conversation

jhawthorn
Copy link
Member

Alternative to #36094

I was able to confirm locally that multiple requests can enter the clear_cache_if_necessary method (I wasn't able to get the same error, but it makes sense that it can happen). I guess this is because we're running in Executor#before rather than as part of Reloader (maybe this is another hint to me that it should be moved there 馃し鈥嶁檪).

Because of this we should wrap clear_cache_if_necessary with a Mutex (this is just the check and clear before a request). This only runs in dev mode, and in my local testing there wasn't a significant performance change to adding the mutex.

cc @kaspth @composerinteralia

@rails-bot rails-bot bot added the actionview label May 22, 2019
@jhawthorn jhawthorn changed the title Wrap cache expiry in a mutex Wrap ActionView cache expiry in a mutex May 22, 2019
@rafaelfranca rafaelfranca merged commit 8f5b271 into rails:master May 23, 2019
rafaelfranca added a commit that referenced this pull request May 23, 2019
Wrap ActionView cache expiry in a mutex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants