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

This class is no more used #2739

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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