From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2106C4338F for ; Fri, 20 Aug 2021 19:33:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2426961155 for ; Fri, 20 Aug 2021 19:33:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2426961155 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:49776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHAGV-0006Wj-0g for qemu-devel@archiver.kernel.org; Fri, 20 Aug 2021 15:33:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHAEc-0005Ew-Qh for qemu-devel@nongnu.org; Fri, 20 Aug 2021 15:31:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHAEY-0001dW-98 for qemu-devel@nongnu.org; Fri, 20 Aug 2021 15:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629487875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KO2Beb/1oYcAadl45wTArgVgODcVAUSsJ7N+u1XfN7w=; b=KMeiH53ps1u4NFXlTUrt0tOcZdrUszxLLbhmPcuIGewVPI/EGT0sr6EfjrhrAH3gY7CUb1 MoaP5jA+bTuum+yuUhUwMxb01KJCZEFzjwESm85NYOw1FghImddELbX6S9958pWcJ+6WXt /ies5sCDdHqIhTS2nXfTmHgqqiLsExs= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-545-io-X3i2POI-l78_aAFQLpg-1; Fri, 20 Aug 2021 15:31:14 -0400 X-MC-Unique: io-X3i2POI-l78_aAFQLpg-1 Received: by mail-ot1-f71.google.com with SMTP id b25-20020a9d60d9000000b00519be3bdc04so5214893otk.7 for ; Fri, 20 Aug 2021 12:31:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KO2Beb/1oYcAadl45wTArgVgODcVAUSsJ7N+u1XfN7w=; b=n9v8a/IVFPTMSCFxL1ucSO4ar3cG0DePOVsxne0SJqIB5h+L/lfgG4CgH7W4pTx5se x0fRiLpgpXKoFWovF2m8HjFlsOkkp8LzaWHgkCFjW1doxWRtq+JwpAxHJxnrQSmB1+ES cx5XbGZ26pF/F/yx1OtNZFGmuWHUdk5M4XT5YRxAefMOgrPGLLXrJCT6ZBcqdpDQ85TL vlaZ6MpEDJsEjeP9SECsEG5sEW/B43RWY8hY4QXxCUmbsfOLcuzgGJDOAitkq9+wwwz2 8PwcV8wouIGqJlimvo0QdidpGiTmywIdCii6wKyrfOFgp8FDZHz7bmHHgGszdVYYtcxq MWPw== X-Gm-Message-State: AOAM531yDXNNqmeZ/HCqtANf0gPtriNgQTLUtGi9wTuR/RffEMweh71v ixdDRPZ3HLdW0GCHuRXyo9GBw8LRNKbPNcWH9RYXTJnV26gGsZCGaD8LakNgBBlBv0n0A5WaIYK b0RaCaumsuAxSPjQU5MZfuyZnWfZkAQI= X-Received: by 2002:a05:6808:a01:: with SMTP id n1mr4004711oij.52.1629487873521; Fri, 20 Aug 2021 12:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXHAKXeYg9lK7RJ8DhbglNu9hKHA2kofTMajqMP+VYKOblXmvpGIEdj29A8Lavi0vwv4Q+6MFjdmFbqJCQRlQ= X-Received: by 2002:a05:6808:a01:: with SMTP id n1mr4004695oij.52.1629487873349; Fri, 20 Aug 2021 12:31:13 -0700 (PDT) MIME-Version: 1.0 References: <20210730201846.5147-1-niteesh.gs@gmail.com> <20210730201846.5147-10-niteesh.gs@gmail.com> In-Reply-To: From: John Snow Date: Fri, 20 Aug 2021 15:31:02 -0400 Message-ID: Subject: Re: [PATCH v3 09/13] python/aqmp-tui: Add QMP connection manager To: "Niteesh G. S." Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000db724605ca02b5ce" Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Kashyap Chamarthy , Markus Armbruster , Wainer Moschetta , qemu-devel , Stefan Hajnoczi , Cleber Rosa , Eric Blake Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000db724605ca02b5ce Content-Type: text/plain; charset="UTF-8" On Wed, Aug 18, 2021 at 3:36 PM John Snow wrote: > On Tue, Aug 17, 2021 at 3:07 PM Niteesh G. S. > wrote: > >> On Tue, Aug 17, 2021 at 10:21 AM John Snow wrote: >> >>> On Fri, Jul 30, 2021 at 4:19 PM G S Niteesh Babu >>> wrote: >>> >> > Is this required? I would have hoped that after calling disconnect that >>> the state would have again changed to IDLE and you wouldn't need this >>> clause here. >>> >> After you mentioned it I too felt it was redundant. But on removing it >> the whole app freezes when trying to exit. >> I logged the state after the call to disconnect, instead of being in the >> IDLE state, it is still in DISCONNECTING state. >> I suspect this results in the constant infinite looping which doesn't >> give other coroutines a chance to run and blocks >> the event loop thus resulting in the freezing of the app. But I am not >> sure why the state isn't changing to IDLE. >> > > Hmm ... That may well be a bug in AQMP then. I will investigate. > No, it's not -- It's just tricky. The "problem" is that the runstate_changed() event only returns once the runstate has changed *after* you await it. So this code is perfectly correct and I am just bad at reading. --js --000000000000db724605ca02b5ce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, Aug 18, 2021 at = 3:36 PM John Snow <jsnow@redhat.com<= /a>> wrote:
<= div dir=3D"ltr">
On Tue, A= ug 17, 2021 at 10:21 AM John Snow <jsnow@redhat.com> wrote:
On Fri, Jul 30, 2021 at 4:19 PM G S= Niteesh Babu <niteesh.gs@gmail.com> wrote:

<= div>Is this required? I would have hoped that after calling disconnect that= the state would have again changed to IDLE and you wouldn't need this = clause here.
After you mentioned it I too felt it was redundant. But on removing= it the whole app freezes when trying to exit.
I logged the state after the call to disconnect, instead of b= eing in the IDLE state, it is still in DISCONNECTING state.
I suspect this results in the constant infinite loopin= g which doesn't give other coroutines a chance to run and blocks
<= div style=3D"font-size:small">the event loop thus resulting in the freezing= of the app. But I am not sure why the state isn't changing to IDLE.

Hmm ... That may well be a = bug in AQMP then. I will investigate.

No, it's not -- It's just tricky. The "proble= m" is that the runstate_changed() event only returns once the runstate= has changed *after* you await it. So this code is perfectly correct and I = am just bad at reading.

--js
= --000000000000db724605ca02b5ce--