cache_store: handle missing process.

If we try to kill the process but it's already dead just ignore it.
This commit is contained in:
Mike McQuaid 2018-09-21 14:09:57 +01:00
parent 108999f7d7
commit 7eb4b92d30
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -89,7 +89,12 @@ class CacheStoreDatabase
end end
rescue ErrorDuringExecution, Timeout::Error rescue ErrorDuringExecution, Timeout::Error
odebug "Failed to read #{dbm_file_path}!" odebug "Failed to read #{dbm_file_path}!"
Process.kill(:KILL, dbm_test_read_cmd.pid) begin
Process.kill(:KILL, dbm_test_read_cmd.pid)
rescue Errno::ESRCH
# Process has already terminated.
nil
end
false false
end end
cache_path.delete unless dbm_test_read_success cache_path.delete unless dbm_test_read_success