From 0fe40f7222e0c3447b909e0269bd33966f495cb9 Mon Sep 17 00:00:00 2001 From: David Pineda Date: Sat, 19 Feb 2022 13:20:43 -0300 Subject: [PATCH] Update net_asyncio.py --- rethinkdb/asyncio_net/net_asyncio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rethinkdb/asyncio_net/net_asyncio.py b/rethinkdb/asyncio_net/net_asyncio.py index 781081e5..6dfd0945 100644 --- a/rethinkdb/asyncio_net/net_asyncio.py +++ b/rethinkdb/asyncio_net/net_asyncio.py @@ -69,7 +69,6 @@ def reusable_waiter(loop, timeout): else: deadline = None - @asyncio.coroutine def wait(future): if deadline is not None: new_timeout = max(deadline - loop.time(), 0) @@ -284,6 +283,7 @@ def close(self, noreply_wait=False, token=None, exception=None): yield from self.run_query(noreply, False) self._streamwriter.close() + await self._streamwriter.wait_closed() # We must not wait for the _reader_task if we got an exception, because that # means that we were called from it. Waiting would lead to a deadlock. if self._reader_task and exception is None: