Skip to content

Commit bcbce1e

Browse files
authored
Merge pull request #1103 from gboutry/fix/async-reconnect
#1103 #### Description Wrap reconnect coroutine in a task. This is due to a breaking change in python stdlib 3.11. Before 3.11 it only emitted a warning. Fixes: #1102 All places calling asyncio.wait are already wrapping into a task: https://github.com/juju/python-libjuju/blob/7d2107f882e5f7927001004dc2dac74a286740eb/juju/model.py#L757 https://github.com/juju/python-libjuju/blob/7d2107f882e5f7927001004dc2dac74a286740eb/juju/utils.py#L179
2 parents c30f1c0 + aed6f8e commit bcbce1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

juju/client/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ async def rpc(self, msg, encoder=None):
656656
# if it is triggered by the pinger, then this RPC call will
657657
# be cancelled when the pinger is cancelled by the reconnect,
658658
# and we don't want the reconnect to be aborted halfway through
659-
await jasyncio.wait([self.reconnect()])
659+
await jasyncio.wait([jasyncio.create_task(self.reconnect())])
660660
if self.monitor.status != Monitor.CONNECTED:
661661
# reconnect failed; abort and shutdown
662662
log.error('RPC: Automatic reconnect failed')

0 commit comments

Comments
 (0)