mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 20:02:38 +09:00
feature #1303: downloader retries writing when the uncompress command is busy
This commit is contained in:
1 parent
fe0ed3c06c
commit
df71bfa3ab
1 file changed
+12
-3
@@ -89,9 +89,18 @@ class Stream
|
||||
|
||||
def process(data)
|
||||
begin
|
||||
@compr_in.write(data)
|
||||
@compr_in.flush
|
||||
rescue Errno::EPIPE
|
||||
try=5
|
||||
begin
|
||||
@compr_in.write(data)
|
||||
@compr_in.flush
|
||||
rescue
|
||||
if try>0
|
||||
try-=1
|
||||
sleep 0.1
|
||||
retry
|
||||
end
|
||||
end
|
||||
rescue
|
||||
STDERR.puts "Error uncompressing image."
|
||||
exit(-1)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user