Except that now I'm getting occasional 'getaddrinfo: nodename nor servname provided, or not known (SocketError)'.
So, if you're reading in data stored in S3 and want it to be reliable, you should wrap it with a generic exception handler and a lot of backing-off retries. With luck, it'll work out for you. Without luck, well, what sort of reliability do you expect from a "cloud"?
max_attempts = 25
attempts = 0
begin
my_stuff = s3object.load
rescue Exception => e
attempts += 1
sleep 1
retry if attempts < max_attempts
end
No comments:
Post a Comment