Skip to content

Commit

Permalink
python/qmp: remove Server.wait_closed() call for Python 3.12
Browse files Browse the repository at this point in the history
This patch is a backport from
https://gitlab.com/qemu-project/python-qemu-qmp/-/commit/e03a3334b6a477beb09b293708632f2c06fe9f61

According to Guido in python/cpython#104344 ,
this call was never meant to wait for the server to shut down - that is
handled synchronously - but instead, this waits for all connections to
close. Or, it would have, if it wasn't broken since it was introduced.

3.12 fixes the bug, which now causes a hang in our code. The fix is just
to remove the wait.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-id: 20231006195243.3131140-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
  • Loading branch information
jnsnow committed Oct 11, 2023
1 parent ff2e081 commit acf8738
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion python/qemu/qmp/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ async def _stop_server(self) -> None:
try:
self.logger.debug("Stopping server.")
self._server.close()
await self._server.wait_closed()
self.logger.debug("Server stopped.")
finally:
self._server = None
Expand Down

0 comments on commit acf8738

Please sign in to comment.