Skip to content

Commit 3de6a36

Browse files
committed
asyncioreactor: initial background_tasks set earlier
in b80960f we introduce this new set, but initialize it after starting the coroutines, which can lead to cases it won't yet be defined. moveing it to the start of the the `__init__` method fixes the issue
1 parent 6b82872 commit 3de6a36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cassandra/io/asyncioreactor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class AsyncioConnection(Connection):
8787

8888
def __init__(self, *args, **kwargs):
8989
Connection.__init__(self, *args, **kwargs)
90+
self._background_tasks = set()
9091

9192
self._connect_socket()
9293
self._socket.setblocking(0)
@@ -106,7 +107,7 @@ def __init__(self, *args, **kwargs):
106107
)
107108
self._send_options_message()
108109

109-
self._background_tasks = set()
110+
110111

111112
@classmethod
112113
def initialize_reactor(cls):

0 commit comments

Comments
 (0)