logstash-filter-ruby icon indicating copy to clipboard operation
logstash-filter-ruby copied to clipboard

avoid rescuing all exception from inline script

Open kares opened this issue 4 years ago • 0 comments

When an unexpected exception occurs with an code => ... inline script, the plugin catches everything due rescue Exception.

This isn't ideal as it will also catch any serious java.lang.Error throwables such as OutOfMemoryError and recover from them.

The issue only concerns inline script, path => ... script reach a default rescue => e form and thus won't recover from errors.


History shows there might not have been a clear intent to rescue "everything", rescue Exception dates back to the (1.0.0) initial support for recovering from Ruby exceptions. Which than got refactored (probably to keep compatibility) with the addition of file based scripting.

kares avatar Jan 06 '21 13:01 kares