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

don't rescue/log process exit or failure exceptions: SystemExit, SystemStackError, NoMemoryError, SecurityError, SignalException #533

Closed
ColinDKelley opened this issue Mar 9, 2021 · 1 comment · Fixed by #535
Assignees

Comments

@ColinDKelley
Copy link
Collaborator

ColinDKelley commented Mar 9, 2021

listen currently rescues Exception but this includes exceptions that indicate process exit or failure. For example, as reported in #532 by @RobinDaugherty:

Using Guard with listen, when Guard is notified by listen that the Guardfile changed, Guard calls exit.

This results in the following alarming output:

E, [2021-03-09T10:48:09.258474 #79158] ERROR -- : Exception rescued in _process_changes:
SystemExit: exit
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/guard-2.16.2/lib/guard.rb:166:in `exit'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/guard-2.16.2/lib/guard.rb:166:in `_guardfile_deprecated_check'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/guard-2.16.2/lib/guard.rb:121:in `block in _listener_callback'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/config.rb:28:in `call'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/processor.rb:117:in `block in _process_changes'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/thread.rb:26:in `rescue_and_log'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/processor.rb:116:in `_process_changes'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/processor.rb:25:in `block in loop_for'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/processor.rb:20:in `loop'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/processor.rb:20:in `loop_for'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/loop.rb:85:in `_process_changes'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/event/loop.rb:51:in `block in start'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/thread.rb:26:in `rescue_and_log'
/opt/rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/listen-3.4.1/lib/listen/thread.rb:18:in `block in new'

To address this, listen should simply rescue StandardError (the default for rescue).

ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 20, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 20, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 21, 2021
ColinDKelley added a commit to Invoca/listen that referenced this issue Mar 22, 2021
@ColinDKelley ColinDKelley linked a pull request Mar 25, 2021 that will close this issue
@ColinDKelley ColinDKelley self-assigned this Mar 25, 2021
@ColinDKelley
Copy link
Collaborator Author

Fixed by #535 in v3.5.0

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

Successfully merging a pull request may close this issue.

1 participant