Skip to content

Commit

Permalink
out_s3: add log to output unexpected error of Tempfile#close (#448)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Watson1978 authored Nov 20, 2024
1 parent 58855ad commit 545e3c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/fluent/plugin/out_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,11 @@ def write(chunk)
end
end
ensure
tmp.close(true) rescue nil
begin
tmp.close(true)
rescue => e
log.info "out_s3: Tempfile#close caused unexpected error", error: e
end
end
end

Expand Down

0 comments on commit 545e3c8

Please sign in to comment.