Commit 3f5b7d16 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

Fixed a few more loop bugs related to 3.10.

parent 2560509c
Pipeline #1648 passed with stages
in 39 seconds
......@@ -220,5 +220,5 @@ class Cluster:
while self._hosts:
host = self._hosts.popleft()
waiters.append(host.close())
await asyncio.gather(*waiters, loop=self._loop)
await asyncio.gather(*waiters)
self._closed = True
......@@ -46,8 +46,7 @@ class Connection:
self._closed = False
self._result_sets = {}
self._receive_task = self._loop.create_task(self._receive())
self._semaphore = asyncio.Semaphore(value=max_inflight,
loop=self._loop)
self._semaphore = asyncio.Semaphore(value=max_inflight)
if isinstance(message_serializer, type):
message_serializer = message_serializer()
self._message_serializer = message_serializer
......
......@@ -189,7 +189,7 @@ class ConnectionPool:
while self._acquired:
conn = self._acquired.popleft()
waiters.append(conn.close())
await asyncio.gather(*waiters, loop=self._loop)
await asyncio.gather(*waiters)
async def _get_connection(self, username, password, max_inflight,
response_timeout, message_serializer, provider):
......
......@@ -22,11 +22,11 @@ def error_handler(fn):
class ResultSet:
"""Gremlin Server response implementated as an async iterator."""
def __init__(self, request_id, timeout, loop):
self._response_queue = asyncio.Queue(loop=loop)
self._response_queue = asyncio.Queue()
self._request_id = request_id
self._loop = loop
self._timeout = timeout
self._done = asyncio.Event(loop=self._loop)
self._done = asyncio.Event()
self._aggregate_to = None
@property
......@@ -82,8 +82,7 @@ class ResultSet:
else:
try:
msg = await asyncio.wait_for(self._response_queue.get(),
timeout=self._timeout,
loop=self._loop)
timeout=self._timeout)
except asyncio.TimeoutError:
self.close()
raise exception.ResponseTimeoutError('Response timed out')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment