def _request(self, method, path, server=None, **kwargs):
while True:<EOL><INDENT>next_server = server or self._get_server()<EOL>try:<EOL><INDENT>response = self.server_pool[next_server].request(<EOL>method, path, username=self.username, password=self.password, schema=self.schema, **kwargs)<EOL>redirect_location = response.get_redirect_location()<EOL>if redirect_location and <NUM_LIT> <= response.status <= <NUM_LIT>:<EOL><INDENT>redirect_server = _server_url(redirect_location)<EOL>self._add_server(redirect_server)<EOL>return self._request(<EOL>method, path, server=redirect_server, **kwargs)<EOL><DEDENT>if not server and response.status in SRV_UNAVAILABLE_STATUSES:<EOL><INDENT>with self._lock:<EOL><INDENT>self._drop_server(next_server, response.reason)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return response<EOL><DEDENT><DEDENT>except (urllib3.exceptions.MaxRetryError,<EOL>urllib3.exceptions.ReadTimeoutError,<EOL>urllib3.exceptions.SSLError,<EOL>urllib3.exceptions.HTTPError,<EOL>urllib3.exceptions.ProxyError,) as ex:<EOL><INDENT>ex_message = _ex_to_message(ex)<EOL>if server:<EOL><INDENT>raise ConnectionError(<EOL>"<STR_LIT>" % ex_message<EOL>)<EOL><DEDENT>preserve_server = False<EOL>if isinstance(ex, urllib3.exceptions.ProtocolError):<EOL><INDENT>preserve_server = any(<EOL>t in [type(arg) for arg in ex.args]<EOL>for t in PRESERVE_ACTIVE_SERVER_EXCEPTIONS<EOL>)<EOL><DEDENT>if (not preserve_server):<EOL><INDENT>with self._lock:<EOL><INDENT>self._drop_server(next_server, ex_message)<EOL><DEDENT><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>raise ProgrammingError(_ex_to_message(e))<EOL><DEDENT><DEDENT>
Execute a request to the cluster

        A server is selected from the server pool.