1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

B #3229: Retry onehost sync on IOError (#3309)

(cherry picked from commit 4a0b133cd23dbe4c2c3a764030c910a10563bcec)
This commit is contained in:
Vlastimil Holer 2019-05-07 14:42:13 +02:00 committed by Ruben S. Montero
parent 8bed8f562c
commit 5a81924d84
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -369,9 +369,20 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
" #{host['NAME']}:#{remote_dir} 2> /dev/null"
end
`#{sync_cmd} 2>/dev/null`
retries = 3
if !$CHILD_STATUS.success?
begin
`#{sync_cmd} 2>/dev/null`
rescue IOError
# Workaround for broken Ruby 2.5
# https://github.com/OpenNebula/one/issues/3229
if (retries -= 1) > 0
sleep 1
retry
end
end
if $CHILD_STATUS.nil? || !$CHILD_STATUS.success?
error_lock.synchronize do
host_errors << host['NAME']
end