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

Ignore Errno::ENOTEMPTY when calling AS::Cache::FileStore#clear with race conditions #36941

Merged
merged 1 commit into from Apr 13, 2020

Conversation

ts-3156
Copy link
Contributor

@ts-3156 ts-3156 commented Aug 15, 2019

Summary

Currently Rails.cache.clear raises Errno::ENOTEMPTY on highly accessed server.
The error just can be ignored.

Other Information

How to reproduce

$ rails r 'Rails.cache.clear'

Stack trace

Traceback (most recent call last):
        23: from bin/rails:4:in `<main>'
        22: from bin/rails:4:in `require'
        21: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/commands.rb:18:in `<top (required)>'
        20: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/command.rb:46:in `invoke'
        19: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/command/base.rb:65:in `perform'
        18: from /project root/.bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        17: from /project root/.bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        16: from /project root/.bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        15: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/commands/runner/runner_command.rb:41:in `perform'
        14: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/commands/runner/runner_command.rb:41:in `eval'
        13: from /project root/.bundle/ruby/2.5.0/gems/railties-5.2.2.1/lib/rails/commands/runner/runner_command.rb:41:in `<main>'
        12: from /project root/.bundle/ruby/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/cache/strategy/local_cache.rb:96:in `clear'
        11: from /project root/.bundle/ruby/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/cache/file_store.rb:34:in `clear'
        10: from /usr/local/lib/ruby/2.5.0/fileutils.rb:553:in `rm_r'
         9: from /usr/local/lib/ruby/2.5.0/fileutils.rb:553:in `each'
         8: from /usr/local/lib/ruby/2.5.0/fileutils.rb:557:in `block in rm_r'
         7: from /usr/local/lib/ruby/2.5.0/fileutils.rb:689:in `remove_entry'
         6: from /usr/local/lib/ruby/2.5.0/fileutils.rb:1386:in `postorder_traverse'
         5: from /usr/local/lib/ruby/2.5.0/fileutils.rb:691:in `block in remove_entry'
         4: from /usr/local/lib/ruby/2.5.0/fileutils.rb:1329:in `remove'
         3: from /usr/local/lib/ruby/2.5.0/fileutils.rb:1336:in `remove_dir1'
         2: from /usr/local/lib/ruby/2.5.0/fileutils.rb:1348:in `platform_support'
         1: from /usr/local/lib/ruby/2.5.0/fileutils.rb:1337:in `block in remove_dir1'
/usr/local/lib/ruby/2.5.0/fileutils.rb:1337:in `rmdir': Directory not empty @ dir_s_rmdir - /project root/tmp/cache/xxx (Errno::ENOTEMPTY)

…race conditions

Currently `Rails.cache.clear` raises Errno::ENOTEMPTY on highly accessed server.
The error just can be ignored.
@ghost
Copy link

ghost commented Aug 16, 2019

+1

1 similar comment
@john1228
Copy link

+1

@rails-bot
Copy link

rails-bot bot commented Jan 15, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Jan 15, 2020
@ts-3156
Copy link
Contributor Author

ts-3156 commented Jan 17, 2020

ping

@rails-bot rails-bot bot removed the stale label Jan 17, 2020
@rafaelfranca rafaelfranca merged commit a0fb2b2 into rails:master Apr 13, 2020
rafaelfranca added a commit that referenced this pull request Apr 13, 2020
Ignore Errno::ENOTEMPTY when calling AS::Cache::FileStore#clear with race conditions
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

3 participants