Browse Source

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.
This patch adds this reconnect in a second place that was missed.

Change-Id: I745aea8dcb51598ca7d7a371dce66c7dd6ae8005
Grzegorz Grasza 4 months ago
parent
commit
f8036d01a5
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      novajoin/ipa.py

+ 8
- 0
novajoin/ipa.py View File

@@ -224,6 +224,14 @@ class IPANovaJoinBase(object):
224 224
                     self.__backoff()
225 225
                 else:
226 226
                     raise
227
+            except http_client.ResponseNotReady:
228
+                # NOTE(xek): This means that the server closed the socket,
229
+                # so keep-alive ended and we can't use that connection.
230
+                api.Backend.rpcclient.disconnect()
231
+                if self.backoff:
232
+                    self.__backoff()
233
+                else:
234
+                    raise
227 235
 
228 236
     def _ipa_client_configured(self):
229 237
         """Determine if the machine is an enrolled IPA client.

Loading…
Cancel
Save