Skip to content

Commit

Permalink
out_s3: add log to output unexpected error of Tempfile#close
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 committed Nov 20, 2024
1 parent 58855ad commit ad72757
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 ad72757

Please sign in to comment.