From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:44262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIwMe-0006cJ-1x for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:25:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIwBA-00074x-Ci for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:13:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIwB8-00073K-W7 for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:13:47 -0400 Date: Tue, 23 Apr 2019 15:13:32 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20190423141332.GN6022@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20190211182442.8542-1-berrange@redhat.com> <46b6b751-4e3f-1b11-9ac7-d0d73cca2227@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <46b6b751-4e3f-1b11-9ac7-d0d73cca2227@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 00/16] chardev: refactoring & many bugfixes related tcp_chr_wait_connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Laurent Vivier , Thomas Huth , Yongji Xie , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Paolo Bonzini , Max Reitz On Mon, Apr 22, 2019 at 09:51:17AM -0500, Eric Blake wrote: > On 2/11/19 12:24 PM, Daniel P. Berrang=C3=A9 wrote: > > This is a followup to > >=20 > > v1: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg03344.= html > > v2: http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg0594= 7.html > >=20 > > This series comes out of a discussion between myself & Yongji Xie in: > >=20 > > https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg01881.html > >=20 > > I eventually understood that the problem faced was that > > tcp_chr_wait_connected was racing with the background connection atte= mpt > > previously started, causing two connections to be established. This > > broke because some vhost user servers only allow a single connection. > >=20 > > After messing around with the code alot the final solution was in fac= t > > very easy. We simply have to delay the first background connection > > attempt until the main loop is running. It will then automatically > > turn into a no-op if tcp_chr_wait_connected has been run. This is > > dealt with in the last patch in this series > >=20 > > I believe this should solve the problem Yongji Xie faced, and thus no= t > > require us to add support for "nowait" option with client sockets at > > all. The reconnect=3D1 option effectively already implements nowait > > semantics, and now plays nicely with tcp_chr_wait_connected. > >=20 > > In investigating this I found various other bugs that needed fixing a= nd > > identified some useful refactoring to simplify / clarify the code, he= nce > > this very long series. >=20 > Even with this series applied, I'm still seeing sporadic failures of > iotest 169. Max posted a hack patch a while back that tries to work > around the race: >=20 > https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg05907.html >=20 > which he originally diagnosed in iotest 147: > https://lists.nongnu.org/archive/html/qemu-devel/2018-12/msg05579.html >=20 > but as it was a hack, he has not pursued it further, and so the symptom= s > are still there, although not completely reproducible: >=20 > 169 10s ... - output mismatch (see 169.out.bad) > --- /home/eblake/qemu/tests/qemu-iotests/169.out 2018-11-16 > 15:48:12.018526748 -0600 > +++ /home/eblake/qemu/tests/qemu-iotests/169.out.bad 2019-04-22 > 09:38:45.481517132 -0500 > @@ -1,3 +1,5 @@ > +WARNING:qemu:qemu received signal 11: > /home/eblake/qemu/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x= 86_64 > -chardev > socket,id=3Dmon,path=3D/home/eblake/qemu/tests/qemu-iotests/scratch/tmp= 4clmPF/qemua-26803-monitor.sock > -mon chardev=3Dmon,mode=3Dcontrol -display none -vga none -qtest > unix:path=3D/home/eblake/qemu/tests/qemu-iotests/scratch/qemua-26803-qt= est.sock > -machine accel=3Dqtest -nodefaults -machine accel=3Dqtest -drive > if=3Dvirtio,id=3Ddrive0,file=3D/home/eblake/qemu/tests/qemu-iotests/scr= atch/disk_a,format=3Dqcow2,cache=3Dwriteback >=20 > Any chance you can take a look as to what a non-hack fix should be? Oh, it looks like we dropped the ball here. We have a fix already but it doesn't appear to have been merged for 4.0 :-( https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06174.html Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :| 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=-2.3 required=3.0 tests=FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham 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 D907BC10F14 for ; Tue, 23 Apr 2019 14:27:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACBBB214AE for ; Tue, 23 Apr 2019 14:27:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACBBB214AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:54573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIwOI-0008PD-S8 for qemu-devel@archiver.kernel.org; Tue, 23 Apr 2019 10:27:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIwMe-0006cJ-1x for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:25:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIwBA-00074x-Ci for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:13:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIwB8-00073K-W7 for qemu-devel@nongnu.org; Tue, 23 Apr 2019 10:13:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C0F53019888; Tue, 23 Apr 2019 14:13:41 +0000 (UTC) Received: from redhat.com (ovpn-112-50.ams2.redhat.com [10.36.112.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DAC9A5C220; Tue, 23 Apr 2019 14:13:35 +0000 (UTC) Date: Tue, 23 Apr 2019 15:13:32 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Eric Blake Message-ID: <20190423141332.GN6022@redhat.com> References: <20190211182442.8542-1-berrange@redhat.com> <46b6b751-4e3f-1b11-9ac7-d0d73cca2227@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <46b6b751-4e3f-1b11-9ac7-d0d73cca2227@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 23 Apr 2019 14:13:41 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH v3 00/16] chardev: refactoring & many bugfixes related tcp_chr_wait_connected X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: Laurent Vivier , Thomas Huth , qemu-devel@nongnu.org, Max Reitz , Yongji Xie , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20190423141332.FuAN6PS5t2v0g6LAf3nY8wMlTKInBV7jrSjjkhWmBXs@z> On Mon, Apr 22, 2019 at 09:51:17AM -0500, Eric Blake wrote: > On 2/11/19 12:24 PM, Daniel P. Berrang=C3=A9 wrote: > > This is a followup to > >=20 > > v1: https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg03344.= html > > v2: http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg0594= 7.html > >=20 > > This series comes out of a discussion between myself & Yongji Xie in: > >=20 > > https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg01881.html > >=20 > > I eventually understood that the problem faced was that > > tcp_chr_wait_connected was racing with the background connection atte= mpt > > previously started, causing two connections to be established. This > > broke because some vhost user servers only allow a single connection. > >=20 > > After messing around with the code alot the final solution was in fac= t > > very easy. We simply have to delay the first background connection > > attempt until the main loop is running. It will then automatically > > turn into a no-op if tcp_chr_wait_connected has been run. This is > > dealt with in the last patch in this series > >=20 > > I believe this should solve the problem Yongji Xie faced, and thus no= t > > require us to add support for "nowait" option with client sockets at > > all. The reconnect=3D1 option effectively already implements nowait > > semantics, and now plays nicely with tcp_chr_wait_connected. > >=20 > > In investigating this I found various other bugs that needed fixing a= nd > > identified some useful refactoring to simplify / clarify the code, he= nce > > this very long series. >=20 > Even with this series applied, I'm still seeing sporadic failures of > iotest 169. Max posted a hack patch a while back that tries to work > around the race: >=20 > https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg05907.html >=20 > which he originally diagnosed in iotest 147: > https://lists.nongnu.org/archive/html/qemu-devel/2018-12/msg05579.html >=20 > but as it was a hack, he has not pursued it further, and so the symptom= s > are still there, although not completely reproducible: >=20 > 169 10s ... - output mismatch (see 169.out.bad) > --- /home/eblake/qemu/tests/qemu-iotests/169.out 2018-11-16 > 15:48:12.018526748 -0600 > +++ /home/eblake/qemu/tests/qemu-iotests/169.out.bad 2019-04-22 > 09:38:45.481517132 -0500 > @@ -1,3 +1,5 @@ > +WARNING:qemu:qemu received signal 11: > /home/eblake/qemu/tests/qemu-iotests/../../x86_64-softmmu/qemu-system-x= 86_64 > -chardev > socket,id=3Dmon,path=3D/home/eblake/qemu/tests/qemu-iotests/scratch/tmp= 4clmPF/qemua-26803-monitor.sock > -mon chardev=3Dmon,mode=3Dcontrol -display none -vga none -qtest > unix:path=3D/home/eblake/qemu/tests/qemu-iotests/scratch/qemua-26803-qt= est.sock > -machine accel=3Dqtest -nodefaults -machine accel=3Dqtest -drive > if=3Dvirtio,id=3Ddrive0,file=3D/home/eblake/qemu/tests/qemu-iotests/scr= atch/disk_a,format=3Dqcow2,cache=3Dwriteback >=20 > Any chance you can take a look as to what a non-hack fix should be? Oh, it looks like we dropped the ball here. We have a fix already but it doesn't appear to have been merged for 4.0 :-( https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg06174.html Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|