Skip to content

Commit 545e3c8

Browse files
authored
out_s3: add log to output unexpected error of Tempfile#close (#448)
It is difficult to take any action deal with as there was no output if Tempfile#close caused unexpected error. So, this patch will add a log to know that an error has occurred in Tempfile#close. Signed-off-by: Shizuo Fujita <[email protected]>
1 parent 58855ad commit 545e3c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/fluent/plugin/out_s3.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,11 @@ def write(chunk)
388388
end
389389
end
390390
ensure
391-
tmp.close(true) rescue nil
391+
begin
392+
tmp.close(true)
393+
rescue => e
394+
log.info "out_s3: Tempfile#close caused unexpected error", error: e
395+
end
392396
end
393397
end
394398

0 commit comments

Comments
 (0)