Reconnect on httplib.ResponseNotReady
In CI we get a random ResponseNotReady exception, which is caused by the server closing the keepalive socket. This will close and retry the connection. Change-Id: I28e51450cbfea8bf7a18e5783355b68f806eb999
This commit is contained in:
parent
45275db240
commit
e8ced3d13c
|
@ -17,6 +17,9 @@ import os
|
|||
import time
|
||||
import uuid
|
||||
|
||||
from six.moves import http_client
|
||||
|
||||
|
||||
try:
|
||||
from gssapi.exceptions import GSSError
|
||||
from ipalib import api
|
||||
|
@ -161,6 +164,13 @@ class IPANovaJoinBase(object):
|
|||
tries += 1
|
||||
if self.backoff:
|
||||
self.__backoff()
|
||||
except http_client.ResponseNotReady:
|
||||
# NOTE(xek): This means that the server closed the socket,
|
||||
# so keep-alive ended and we can't use that connection.
|
||||
api.Backend.rpcclient.disconnect()
|
||||
tries += 1
|
||||
if self.backoff:
|
||||
self.__backoff()
|
||||
else:
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue