Merge "NSX-mh: Failover controller connections on socket failures"
This commit is contained in:
commit
9a1395ec1e
@ -66,8 +66,8 @@ class EventletApiClient(base.ApiClientBase):
|
||||
# Connection pool is a list of queues.
|
||||
self._conn_pool = eventlet.queue.PriorityQueue()
|
||||
self._next_conn_priority = 1
|
||||
for host, port, is_ssl in api_providers:
|
||||
for _ in range(concurrent_connections):
|
||||
for _ in range(concurrent_connections):
|
||||
for host, port, is_ssl in api_providers:
|
||||
conn = self._create_connection(host, port, is_ssl)
|
||||
self._conn_pool.put((self._next_conn_priority, conn))
|
||||
self._next_conn_priority += 1
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
import abc
|
||||
import copy
|
||||
import socket
|
||||
import time
|
||||
|
||||
import eventlet
|
||||
@ -186,9 +187,12 @@ class ApiRequest(object):
|
||||
'url': self._url, 'status': response.status})
|
||||
raise Exception(_('Server error return: %s'), response.status)
|
||||
return response
|
||||
except socket.error:
|
||||
is_conn_service_unavail = True
|
||||
except Exception as e:
|
||||
if isinstance(e, httplib.BadStatusLine):
|
||||
msg = (_("Invalid server response"))
|
||||
|
||||
else:
|
||||
msg = str(e)
|
||||
if response is None:
|
||||
|
Loading…
Reference in New Issue
Block a user