Skip to content

Commit 8ed8aeb

Browse files
authored
Merge pull request #2149 from Etsukata/emit-backtrace-on-unrecoverable-errors
emit backtrace on UNRECOVERABLE_ERRORS
2 parents 0751902 + 014a942 commit 8ed8aeb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/fluent/plugin/output.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1122,31 +1122,37 @@ def try_flush
11221122
if @secondary
11231123
if using_secondary
11241124
log.warn "got unrecoverable error in secondary.", error: e
1125+
log.warn_backtrace
11251126
backup_chunk(chunk, using_secondary, output.delayed_commit)
11261127
else
11271128
if (self.class == @secondary.class)
11281129
log.warn "got unrecoverable error in primary and secondary type is same as primary. Skip secondary", error: e
1130+
log.warn_backtrace
11291131
backup_chunk(chunk, using_secondary, output.delayed_commit)
11301132
else
11311133
# Call secondary output directly without retry update.
11321134
# In this case, delayed commit causes inconsistent state in dequeued chunks so async output in secondary is not allowed for now.
11331135
if @secondary.delayed_commit
11341136
log.warn "got unrecoverable error in primary and secondary is async output. Skip secondary for backup", error: e
1137+
log.warn_backtrace
11351138
backup_chunk(chunk, using_secondary, output.delayed_commit)
11361139
else
11371140
log.warn "got unrecoverable error in primary. Skip retry and flush chunk to secondary", error: e
1141+
log.warn_backtrace
11381142
begin
11391143
@secondary.write(chunk)
11401144
commit_write(chunk_id, delayed: output.delayed_commit, secondary: true)
11411145
rescue => e
11421146
log.warn "got an error in secondary for unrecoverable error", error: e
1147+
log.warn_backtrace
11431148
backup_chunk(chunk, using_secondary, output.delayed_commit)
11441149
end
11451150
end
11461151
end
11471152
end
11481153
else
11491154
log.warn "got unrecoverable error in primary and no secondary", error: e
1155+
log.warn_backtrace
11501156
backup_chunk(chunk, using_secondary, output.delayed_commit)
11511157
end
11521158
rescue => e

0 commit comments

Comments
 (0)