summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Grasza <xek@redhat.com>2018-11-13 11:51:41 +0100
committerGrzegorz Grasza <xek@redhat.com>2018-11-13 12:33:20 +0100
commite8ced3d13c61bb3278c7c2b2ae4167fb3f1ae242 (patch)
treec3978d0b9ff9b24dc60c5d105539f7481d30e476
parent45275db240f6ca1c58a47b23e19bd463cb7fc7d2 (diff)
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
Notes
Notes (review): Code-Review+2: Juan Antonio Osorio Robles <jaosorior@redhat.com> Workflow+1: Juan Antonio Osorio Robles <jaosorior@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 22 Nov 2018 11:24:25 +0000 Reviewed-on: https://review.openstack.org/617571 Project: openstack/novajoin Branch: refs/heads/master
-rw-r--r--novajoin/ipa.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/novajoin/ipa.py b/novajoin/ipa.py
index 42ae81c..f5f2497 100644
--- a/novajoin/ipa.py
+++ b/novajoin/ipa.py
@@ -17,6 +17,9 @@ import os
17import time 17import time
18import uuid 18import uuid
19 19
20from six.moves import http_client
21
22
20try: 23try:
21 from gssapi.exceptions import GSSError 24 from gssapi.exceptions import GSSError
22 from ipalib import api 25 from ipalib import api
@@ -161,6 +164,13 @@ class IPANovaJoinBase(object):
161 tries += 1 164 tries += 1
162 if self.backoff: 165 if self.backoff:
163 self.__backoff() 166 self.__backoff()
167 except http_client.ResponseNotReady:
168 # NOTE(xek): This means that the server closed the socket,
169 # so keep-alive ended and we can't use that connection.
170 api.Backend.rpcclient.disconnect()
171 tries += 1
172 if self.backoff:
173 self.__backoff()
164 else: 174 else:
165 return 175 return
166 176