Skip to content

Commit

Permalink
Merge pull request #2739 from ganmacs/remove-unused-class
Browse files Browse the repository at this point in the history
This class is no more used
  • Loading branch information
ganmacs authored Dec 18, 2019
2 parents fcef949 + 8d9bd84 commit 9ff9d79
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
30 changes: 0 additions & 30 deletions lib/fluent/root_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def configure(conf)
def setup_error_label(e)
error_label = add_label(ERROR_LABEL)
error_label.configure(e)
error_label.root_agent = RootAgentProxyWithoutErrorCollector.new(self)
@error_collector = error_label.event_router
end

Expand Down Expand Up @@ -363,34 +362,5 @@ def handle_emits_error(tag, es, error)
raise error
end
end

# <label @ERROR> element use RootAgent wrapped by # this RootAgentProxyWithoutErrorCollector.
# So that those elements don't send cause infinite loop.
class RootAgentProxyWithoutErrorCollector < SimpleDelegator
def initialize(root_agent)
super

@suppress_emit_error_log_interval = 0
@next_emit_error_log_time = nil

interval_time = root_agent.instance_variable_get(:@suppress_emit_error_log_interval)
suppress_interval(interval_time) unless interval_time.zero?
end

def emit_error_event(tag, time, record, error)
error_info = {error: error, location: (error.backtrace ? error.backtrace.first : nil), tag: tag, time: time, record: record}
log.warn "dump an error event in @ERROR:", error_info
end

def handle_emits_error(tag, es, e)
now = EventTime.now.to_i
if @suppress_emit_error_log_interval.zero? || now > @next_emit_error_log_time
log.warn "emit transaction failed in @ERROR:", error: e, tag: tag
log.warn_backtrace
@next_emit_error_log_time = now + @suppress_emit_error_log_interval
end
raise e
end
end
end
end
2 changes: 0 additions & 2 deletions test/test_root_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def configure_ra(conf_str)

error_label = ra.labels['@ERROR']
assert_kind_of Fluent::Plugin::NullOutput, error_label.outputs.first
assert_kind_of RootAgent::RootAgentProxyWithoutErrorCollector, error_label.root_agent
end
end

Expand Down Expand Up @@ -853,7 +852,6 @@ def configure_ra(conf_str)

error_label = ra.labels['@ERROR']
assert_kind_of Fluent::Plugin::NullOutput, error_label.outputs.first
assert_kind_of RootAgent::RootAgentProxyWithoutErrorCollector, error_label.root_agent
end

test 'with plugins but for another worker' do
Expand Down

0 comments on commit 9ff9d79

Please sign in to comment.