Skip to content

Commit 0947b7d

Browse files
authored
Revert backup chunk specification for suppressing useless chunk backup sets
"Fluent::Unrecoverable Error" make the log set backup per a whole chunk unit, not only relevant log message. It cause irrelevant logs lost due to whole chunk backup, in other words, not sending and backup whole chunk data set including the bigger log than 256 kb. In addition the chunk backup file is remained as useless things, because there is no solution to restore the backup sets now. Refer fluent/fluentd#3813
1 parent 7287d1a commit 0947b7d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/fluent/plugin/out_cloudwatch_logs.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ module Fluent::Plugin
77
class CloudwatchLogsOutput < Output
88
Fluent::Plugin.register_output('cloudwatch_logs', self)
99

10-
class TooLargeEventError < Fluent::UnrecoverableError; end
11-
1210
helpers :compat_parameters, :inject, :formatter
1311

1412
DEFAULT_BUFFER_TYPE = "memory"
@@ -379,7 +377,8 @@ def put_events_by_chunk(group_name, stream_name, events)
379377
while event = events.shift
380378
event_bytesize = event[:message].bytesize + EVENT_HEADER_SIZE
381379
if MAX_EVENT_SIZE < event_bytesize
382-
raise TooLargeEventError, "Log event in #{group_name} is discarded because it is too large: #{event_bytesize} bytes exceeds limit of #{MAX_EVENT_SIZE}"
380+
log.warn "Log event in #{group_name} is discarded because it is too large: #{event_bytesize} bytes exceeds limit of #{MAX_EVENT_SIZE}"
381+
break
383382
end
384383

385384
new_chunk = chunk + [event]

0 commit comments

Comments
 (0)