- detect when an index is corrupt (index.flush throws an exception),

log a fatal error, and kill the entire logstashd process.
This commit is contained in:
Pete Fritchman 2009-11-08 07:20:38 +00:00
parent 8b7b1b4623
commit c5448cf479

View file

@ -232,7 +232,12 @@ module LogStash; module Net; module Servers
@indexes.each do |log_type, index|
# TODO: only run flush if we need to
@logger.debug "Forcing a sync of #{log_type}"
index.flush
begin
index.flush
rescue EOFError
@logger.fatal "#{log_type}'s index is corrupt: #{$!}."
exit(2)
end
end
synctime = Time.now + SYNC_DELAY