-
Notifications
You must be signed in to change notification settings - Fork 436
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
All exceptions — including signals — are caught during an observation #60
Comments
djrodgerspryor
added a commit
to djrodgerspryor/scientist
that referenced
this issue
Dec 12, 2016
`rescue Object` is equivalent to `rescue Exception`, which will catch signals and other messages which shouldn't be silenced during an experiment. See github#60
djrodgerspryor
changed the title
All exceptions — including signals — are ignored during an observation
All exceptions — including signals — are caught during an observation
Dec 12, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
observation.rb
does this:Which is a well documented anti-pattern. In particular, it means that any signals (eg.
<SignalException: SIGTERM>
) will be treated as-if they were just an error in the candidate code (which usually means logging and ignoring).Note: There's no difference between
rescue Object
andrescue Exception
because raising a non-exception (eg. a string) will either raise a<TypeError: exception class/object expected>
or a<RuntimeError: Some string>
.I think the standard pattern —
rescue StandardError
— is correct here. That will catch everything exceptSignalException
s and other things which aren't meant to be dealt-with as part of standard error handling.Although users could filter-out all non-StandardError Exceptions themselves, this feels like a footgun (since signals will be relatively rare — especially in development — most users won't notice any problems until they happen in production).
The text was updated successfully, but these errors were encountered: