mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- 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:
parent
8b7b1b4623
commit
c5448cf479
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue