From: John Snow <jsnow@redhat.com>
To: G S Niteesh Babu <niteesh.gs@gmail.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
Kashyap Chamarthy <kchamart@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Wainer Moschetta <wainersm@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>,
Cleber Rosa <crosa@redhat.com>, Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v3 01/13] python/aqmp: Fix wait_closed work-around for python 3.6
Date: Thu, 5 Aug 2021 13:28:21 -0400 [thread overview]
Message-ID: <CAFn=p-Yk2rZLxfPwpT62kktSC0RPuyDu81B=Ojzjgx2Xc6GEZw@mail.gmail.com> (raw)
In-Reply-To: <20210730201846.5147-2-niteesh.gs@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]
On Fri, Jul 30, 2021 at 4:19 PM G S Niteesh Babu <niteesh.gs@gmail.com>
wrote:
> Before this patch the wait_closed work-around for python 3.6
> fails during disconnect.
> This is a temproray work around for which might be fixed in the
> future or will be completely removed when the minimum python
> version is raised to 3.7.
>
> This patch was originally written by John Snow <jsnow@redhat.com>
>
> Signed-off-by: G S Niteesh Babu <niteesh.gs@gmail.com>
> ---
> python/qemu/aqmp/util.py | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/python/qemu/aqmp/util.py b/python/qemu/aqmp/util.py
> index de0df44cbd..eaa5fc7d5f 100644
> --- a/python/qemu/aqmp/util.py
> +++ b/python/qemu/aqmp/util.py
> @@ -134,7 +134,17 @@ def is_closing(writer: asyncio.StreamWriter) -> bool:
>
> while not transport.is_closing():
> await asyncio.sleep(0)
> - await flush(writer)
> +
> + # This is an ugly workaround, but it's the best I can come up with.
> + sock = transport.get_extra_info('socket')
> +
> + if sock is None:
> + # Our transport doesn't have a socket? ...
> + # Nothing we can reasonably do.
> + return
> +
> + while sock.fileno() != -1:
> + await asyncio.sleep(0)
>
>
> def asyncio_run(coro: Coroutine[Any, Any, T], *, debug: bool = False) ->
> T:
> --
> 2.17.1
>
>
Sorry for the trouble. This is now included in the v3 version of my series
and can be dropped. I hope.
[-- Attachment #2: Type: text/html, Size: 2101 bytes --]
next prev parent reply other threads:[~2021-08-05 17:29 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-30 20:18 [PATCH v3 00/13] AQMP TUI Draft G S Niteesh Babu
2021-07-30 20:18 ` [PATCH v3 01/13] python/aqmp: Fix wait_closed work-around for python 3.6 G S Niteesh Babu
2021-08-05 17:28 ` John Snow [this message]
2021-08-10 19:54 ` Niteesh G. S.
2021-07-30 20:18 ` [PATCH v3 02/13] python: disable pylint errors for aqmp-tui G S Niteesh Babu
2021-08-05 17:39 ` John Snow
2021-07-30 20:18 ` [PATCH v3 03/13] python: Add dependencies for AQMP TUI G S Niteesh Babu
2021-08-05 17:44 ` John Snow
2021-07-30 20:18 ` [PATCH v3 04/13] python/aqmp-tui: Add AQMP TUI draft G S Niteesh Babu
2021-08-05 18:58 ` John Snow
2021-08-13 15:10 ` Niteesh G. S.
2021-08-18 18:22 ` John Snow
2021-08-18 19:45 ` Niteesh G. S.
2021-08-05 19:11 ` John Snow
2021-08-13 14:38 ` Niteesh G. S.
2021-07-30 20:18 ` [PATCH v3 05/13] python: add entry point for aqmp-tui G S Niteesh Babu
2021-08-05 19:14 ` John Snow
2021-07-30 20:18 ` [PATCH v3 06/13] python/aqmp-tui: Added type annotations " G S Niteesh Babu
2021-08-05 19:56 ` John Snow
2021-08-10 17:12 ` Niteesh G. S.
2021-07-30 20:18 ` [PATCH v3 07/13] python: add optional pygments dependency G S Niteesh Babu
2021-08-16 19:37 ` John Snow
2021-07-30 20:18 ` [PATCH v3 08/13] python/aqmp-tui: add syntax highlighting G S Niteesh Babu
2021-08-16 19:44 ` John Snow
2021-08-16 21:19 ` Niteesh G. S.
2021-08-18 18:55 ` John Snow
2021-07-30 20:18 ` [PATCH v3 09/13] python/aqmp-tui: Add QMP connection manager G S Niteesh Babu
2021-08-17 4:50 ` John Snow
2021-08-17 19:06 ` Niteesh G. S.
2021-08-18 19:36 ` John Snow
2021-08-20 19:31 ` John Snow
2021-07-30 20:18 ` [PATCH v3 10/13] python/aqmp-tui: Add scrolling to history box G S Niteesh Babu
2021-07-30 20:18 ` [PATCH v3 11/13] python/aqmp-tui: Add ability to highlight messages G S Niteesh Babu
2021-07-30 20:18 ` [PATCH v3 12/13] python/aqmp-tui: Add pyperclip dependency G S Niteesh Babu
2021-07-30 20:18 ` [PATCH v3 13/13] python/aqmp-tui: Allow copying message from TUI G S Niteesh Babu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFn=p-Yk2rZLxfPwpT62kktSC0RPuyDu81B=Ojzjgx2Xc6GEZw@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kchamart@redhat.com \
--cc=niteesh.gs@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wainersm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).