From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 76EEB1F122; Sat, 29 Nov 2025 17:38:37 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 06D1B1F100; Sat, 29 Nov 2025 17:38:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) by atuin.qyliss.net (Postfix) with ESMTPS id 820EA1F07F for ; Sat, 29 Nov 2025 17:38:32 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 6967A7A0069; Sat, 29 Nov 2025 12:38:28 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Sat, 29 Nov 2025 12:38:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1764437908; x=1764524308; bh=T89H2+/yAv Yb81xQ+0N82DdHO4MNz7ABnrrj3TWUNm0=; b=GcfaHqUsjzHsLAVIbDX0TOd/Ks l9BD99MLeztNefP8iB8W+aygqPzAFTJ7X7iTzt8IW29Nqe3NFm6lK6qwezqNgGWk QBvmCwPrxVzI5qP3WphK+WlyWuF9JtnjB+okPQ3nZQ3uVJSsha4/6fCPjldgFoPo oVzPVtFoiY/Om/KHRFz4VFHQg5N6bWlHLt3sPTvjsH8qbhMiYeGUXT3Q2NPgC+3b 92Rvyd5UvlM63RYGOZwcKW3sVuurYKHOaAXZZXfgLdlrKWZvzqoEqNi167D0fIq2 6l0dBF9lsI6BU7jfknabQU6eVRA/PGFl9WEcGnVfBUIM50qTZhsU4l3cVHeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1764437908; x=1764524308; bh=T89H2+/yAvYb81xQ+0N82DdHO4MNz7ABnrr j3TWUNm0=; b=Pt7DhQ1xGQUZ12cxhw+/H6irYK/jiheQod5KMdAz6XPwGg++D5f bhRMf1igtzwyQavgCqJ7p/ITgs4XRSY6e6dttk0eokwfvNzH5NjmXcFSxzORVvYr F1rquorZ+pciCXWEz3qA4Fqyvu5aEuPXVNX5R7KiY8LURRWQAhklcQQ8EW0jSU0r J2w8gDhCeJduYLJDAjRQZsjY1drTkZzUWVYGwLcIZUk0UQRhTwBPg1ohwrudsOlS 2T1xaXQeufy9tFzXQtCpP0nHxYDso0Q1JKWgibeOzgcWoqysHjLYzxzbE8jFhvFl sbse5negSugi/dhjVNcS4QsGdp8FF+Mol4Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheeftdejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvfevufgjfhffkfggtgesghdtreertd dttdenucfhrhhomheptehlhihsshgrucftohhsshcuoehhihesrghlhihsshgrrdhisheq necuggftrfgrthhtvghrnhepveejieekheffueehjeevtdekleelhfehhfelgeffieeiud dvueeifeetkeelffdvnecuffhomhgrihhnpehsphgvtghtrhhumhdqohhsrdhorhhgnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlh ihshhsrgdrihhspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgt phhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhsrdhorhhgpdhrtghpthhtohephi hukhgrseihuhhkrgdruggvvh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Nov 2025 12:38:27 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id B6A913115ECA; Sat, 29 Nov 2025 18:38:25 +0100 (CET) From: Alyssa Ross To: Yureka Subject: Re: [PATCH] release/checks/integration: handle partial sends In-Reply-To: References: <20251129163521.717709-2-hi@alyssa.is> Date: Sat, 29 Nov 2025 18:38:24 +0100 Message-ID: <87ikesn3hr.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: ISDCTH32T342R3UMAM2IICV7X63T3MDQ X-Message-ID-Hash: ISDCTH32T342R3UMAM2IICV7X63T3MDQ X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: devel@spectrum-os.org X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Yureka writes: > Thanks for looking into this. > > On 11/29/25 17:35, Alyssa Ross wrote: >> Sometimes we see a test failure that looks like this: >> >> unexpected connection data: qemu-system-aarch64: terminating on signal=20 >> 15 from pid 184 () >> >> I think this is because, now that the nc command in the networking >> integration test has a timeout, it's possible for it to time out after >> having opened the connection, but before having written all its input >> to it. Therefore, ignore connections that send a prefix of the >> expected data (including nothing), and just wait for the next >> connection rather than failing if that happens. >> >> Closes:=20 >> https://spectrum-os.org/lists/archives/spectrum-devel/875xbl33vw.fsf@aly= ssa.is/ >> Fixes: c61b297 ("release/checks/integration: add nc timeout") >> Signed-off-by: Alyssa Ross >> --- >> Please test! It's difficult to know if I've solved the problem for >> real, since it happens transiently. >> >> release/checks/integration/networking.c | 49 +++++++++++++++---------- >> 1 file changed, 30 insertions(+), 19 deletions(-) >> >> diff --git a/release/checks/integration/networking.c=20 >> b/release/checks/integration/networking.c >> index 97d7895..a445af1 100644 >> --- a/release/checks/integration/networking.c >> +++ b/release/checks/integration/networking.c >> @@ -57,32 +57,43 @@ static int setup_server(void) >> static void expect_connection(int listener) >> { >> - int conn_fd; >> - FILE *conn; >> + int conn, r; >> char msg[7]; >> size_t len; >> - fputs("waiting for server connection\n", stderr); >> - if ((conn_fd =3D accept(listener, nullptr, nullptr)) =3D=3D -1) { >> - perror("accept"); >> - exit(EXIT_FAILURE); >> - } >> - fputs("accepted connection!\n", stderr); >> - if (!(conn =3D fdopen(conn_fd, "r"))) { >> - perror("fdopen(server connection)"); >> - exit(EXIT_FAILURE); >> - } >> + for (;;) { >> + len =3D 0; >> - len =3D fread(msg, 1, sizeof msg, conn); >> - if (len !=3D 6 || memcmp("hello\n", msg, 6)) { >> - if (ferror(conn)) >> - perror("fread(server connection)"); >> - else >> + fputs("waiting for server connection\n", stderr); >> + if ((conn =3D accept(listener, nullptr, nullptr)) =3D=3D -1) { >> + perror("accept"); >> + exit(EXIT_FAILURE); >> + } >> + fputs("accepted connection!\n", stderr); >> + >> + for (;;) { >> + r =3D read(conn, msg + len, sizeof msg - len); >> + if (r =3D=3D -1) { >> + perror("read"); >> + exit(EXIT_FAILURE); >> + } >> + if (r =3D=3D 0) >> + break; >> + len +=3D r; >> + } >> + >> + if (memcmp("hello\n", msg, len) || len > 6) { >> fprintf(stderr, "unexpected connection data: %.*s", >> (int)len, msg); >> - exit(EXIT_FAILURE); >> + exit(EXIT_FAILURE); >> + } >> + >> + // If connection was disconnect partway through, try again. >> + if (len < 6) >> + continue; >> + >> + return; >> } >> - fclose(conn); > > Is it intentional that the connection is never closed? It is not, thanks! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQGoGac7QfI+H5ZtFCZddwkt31pFQUCaSsvkAAKCRCZddwkt31p FYY9AQDNPjyRHTLg/e80+zqqgI5erdpkU4idNr3tUFGWYp2WfQD/e0hn6D7IS4Jp lGYSUwx1mK+uzW2EjWamFk+dLgYNvAs= =B3rY -----END PGP SIGNATURE----- --=-=-=--