Skip to content

Commit cbfe335

Browse files
committed
revert - prefer rescuing StandardError over Exception
Signed-off-by: shubhendra <[email protected]>
1 parent de3b376 commit cbfe335

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

lib/fluent/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def run
152152
sleep MAINLOOP_SLEEP_INTERVAL until @engine_stopped
153153
$log.info "fluentd worker is now stopping", worker: worker_id
154154

155-
rescue StandardError => e
155+
rescue Exception => e
156156
$log.error "unexpected error", error: e
157157
$log.error_backtrace
158158
raise

lib/fluent/plugin/multi_output.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def call_lifecycle_method(method_name, checker_name)
9595
begin
9696
log.debug "calling #{method_name} on output plugin dynamically created", type: Fluent::Plugin.lookup_type_from_class(o.class), plugin_id: o.plugin_id
9797
o.__send__(method_name) unless o.__send__(checker_name)
98-
rescue StandardError => e
98+
rescue Exception => e
9999
log.warn "unexpected error while calling #{method_name} on output plugin dynamically created", plugin: o.class, plugin_id: o.plugin_id, error: e
100100
log.warn_backtrace
101101
end

lib/fluent/plugin_helper/thread.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def thread_create(title)
7777
begin
7878
yield
7979
thread_exit = true
80-
rescue StandardError => e
80+
rescue Exception => e
8181
log.warn "thread exited by unexpected error", plugin: self.class, title: title, error: e
8282
thread_exit = true
8383
raise

lib/fluent/root_agent.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def shutdown # Fluentd's shutdown sequence is stop, before_shutdown, shutdown, a
238238
begin
239239
log.debug "calling #{method} on #{kind} plugin", type: Plugin.lookup_type_from_class(instance.class), plugin_id: instance.plugin_id
240240
instance.__send__(method) unless instance.__send__(checker)
241-
rescue StandardError => e
241+
rescue Exception => e
242242
log.warn "unexpected error while calling #{method} on #{kind} plugin", plugin: instance.class, plugin_id: instance.plugin_id, error: e
243243
log.warn_backtrace
244244
end
@@ -268,7 +268,7 @@ def shutdown # Fluentd's shutdown sequence is stop, before_shutdown, shutdown, a
268268
log.debug "#{operation} #{kind} plugin", type: Plugin.lookup_type_from_class(instance.class), plugin_id: instance.plugin_id
269269
begin
270270
instance.__send__(:before_shutdown) unless instance.__send__(:before_shutdown?)
271-
rescue StandardError => e
271+
rescue Exception => e
272272
log.warn "unexpected error while #{operation} on #{kind} plugin", plugin: instance.class, plugin_id: instance.plugin_id, error: e
273273
log.warn_backtrace
274274
end
@@ -279,7 +279,7 @@ def shutdown # Fluentd's shutdown sequence is stop, before_shutdown, shutdown, a
279279
log.debug "#{operation} #{kind} plugin", type: Plugin.lookup_type_from_class(instance.class), plugin_id: instance.plugin_id
280280
instance.__send__(method) unless instance.__send__(checker)
281281
end
282-
rescue StandardError => e
282+
rescue Exception => e
283283
log.warn "unexpected error while #{operation} on #{kind} plugin", plugin: instance.class, plugin_id: instance.plugin_id, error: e
284284
log.warn_backtrace
285285
end

lib/fluent/supervisor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ def options
673673
def run_worker
674674
begin
675675
require 'sigdump/setup'
676-
rescue StandardError
676+
rescue Exception
677677
# ignore LoadError and others (related with signals): it may raise these errors in Windows
678678
end
679679

@@ -893,7 +893,7 @@ def flush_buffer
893893
@log.reopen!
894894
Fluent::Engine.flush!
895895
$log.debug "flushing thread: flushed"
896-
rescue StandardError => e
896+
rescue Exception => e
897897
$log.warn "flushing thread error: #{e}"
898898
end
899899
end

lib/fluent/winsvc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,6 @@ def set_event(event_name)
9898

9999
FluentdService.new(opts[:service_name]).mainloop
100100

101-
rescue StandardError => err
101+
rescue Exception => err
102102
raise
103103
end

0 commit comments

Comments
 (0)