Skip to content

Commit

Permalink
avoid EventedFileUpdateChecker to avoid system crashes
Browse files Browse the repository at this point in the history
Because of the tendency of rb-fsevent (used by listen on mac) to create zombie processes and because of the rather low default number of allowed processes on mac (709), using the EventedFileUpdateChecker can cause the system to become unusable which can then only be fixed by a reboot (as kill requires forking).

Please also see:

* rails/rails#26158
* puma/puma-dev#56 (comment)
* ledermann/docker-rails@148540d
  • Loading branch information
ulferts committed Feb 8, 2019
1 parent c2ceef7 commit f920cc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ ruby '~> 2.5.1'
gem 'actionpack-xml_parser', '~> 2.0.0'
gem 'activemodel-serializers-xml', '~> 1.0.1'
gem 'activerecord-session_store', '~> 1.1.0'
gem 'listen', '~> 3.1' # Use for event-based reloaders
gem 'rails', '~> 5.2.2'
gem 'responders', '~> 2.4'

Expand Down
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,6 @@ GEM
addressable (~> 2.3)
letter_opener (1.7.0)
launchy (~> 2.2)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
livingstyleguide (2.0.3)
minisyntax (>= 0.2.5)
redcarpet
Expand Down Expand Up @@ -754,7 +750,6 @@ GEM
ruby-rc4 (0.1.5)
ruby-saml (1.9.0)
nokogiri (>= 1.5.10)
ruby_dep (1.5.0)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sanitize (5.0.0)
Expand Down Expand Up @@ -932,7 +927,6 @@ DEPENDENCIES
json_spec (~> 1.1.4)
launchy (~> 2.4.3)
letter_opener
listen (~> 3.1)
livingstyleguide (~> 2.0.1)
lograge (~> 0.10.0)
meta-tags (~> 2.11.0)
Expand Down
7 changes: 5 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@
# Do not eager load code on boot.
config.eager_load = false

# Asynchronous file watcher
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# File watcher
# using ActiveSupport::EventedFileUpdateChecker depends on listen which depends on fsevent
# which seems to be prone to creating zombie process (+200 of them) which can cause
# the process limit (on mac) to be reached which causes the system to need a reboot.
config.file_watcher = ActiveSupport::FileUpdateChecker

# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = :local
Expand Down

0 comments on commit f920cc7

Please sign in to comment.