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 80F1C1EB7B; Sat, 29 Nov 2025 16:35:56 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id C448E1EB6B; Sat, 29 Nov 2025 16:35:53 +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 0F2131EBF1 for ; Sat, 29 Nov 2025 16:35:52 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 1068C7A00D4; Sat, 29 Nov 2025 11:35:48 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sat, 29 Nov 2025 11:35:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1764434147; x=1764520547; bh=nbzj4CypZbH4yq5z5LVYy XZiiAL6TSq9eQgdHUNrDyI=; b=NSenr/IKHnY6DzkH92x9XiBpMvNU1hgG1Kax9 LcZOSfSvo95K2UN2sHK7ljX//GxZ7gYhIw45/B1RVhb+40vhDPVa6xRQQX07SYnC XoNYCAgDm8HbUvIt2O06VJ2hGXe1yAGxsv5uef0GsnWaEWfmcDzenh33uiSu5s/t ULrTvtHgVVe5+kOBe5ZXPbNxDOJU3m77pWTBOWMpGjnbVMmBU6fKUEEdHs3cX/KN O7oWec3kJuKG5D1vQClA6+5bVjZ6F9KYDP1CIM7oTtDKZE27Fafz51oACMRC2P1E CqmhhCcdBIs4Mrxv5kMMNlvrFG2yAQpN5Iz4rE8I7KfmeKGKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1764434147; x=1764520547; bh=nbzj4CypZbH4yq5z5LVYyXZiiAL6TSq9eQg dHUNrDyI=; b=huWoMjegrHPHoi3XefjnB6pdRcHMU2ZQJ9iShfMOqJfR8BrXgp8 tCGaXgKvu5GJnwaJu0cZ0ssBmZtm4NdHurr9TloEx1XCixEo2umJQIBVtl0mXOwx jR5AcV+O7bCk+z1sEqDs4xcq6tpepFvZTKMWmhF34bpszOTynKWttv0WZgzTxI8I seLqLqqn1vo4vxPnlSaRgEetyX468zqfblq3jKlxq4LCyg4sYd3zg96xtNL59Etz IVvWMHBiJpLzC3SGihcsM5UNCL87Tqr8Gwaz6w86LvRgrd7FLmyHJfYUBl2n1PVn iUvwkFPBAJxnUSdZZluuYChUNlZJwwa2+tQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvhedvleeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepkedugfekfe efvdeihedtheevjeetueejhffhuddtueffhfeikeevteffheefgeevnecuffhomhgrihhn pehsphgvtghtrhhumhdqohhsrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrihhspdhnsggprhgtphhtthho peefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeihuhhrvghkrgestgihsggvrh gthhgrohhsrdguvghvpdhrtghpthhtohepuggvmhhiohgsvghnohhurhesghhmrghilhdr tghomhdprhgtphhtthhopeguvghvvghlsehsphgvtghtrhhumhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Nov 2025 11:35:46 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id D705E2FF5E11; Sat, 29 Nov 2025 17:35:44 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH] release/checks/integration: handle partial sends Date: Sat, 29 Nov 2025 17:35:22 +0100 Message-ID: <20251129163521.717709-2-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: TL2FEIPJBCAQHDZVAN6ATIVPRTOQMIMG X-Message-ID-Hash: TL2FEIPJBCAQHDZVAN6ATIVPRTOQMIMG 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: Demi Marie Obenour , Yureka Lilian 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: Sometimes we see a test failure that looks like this: unexpected connection data: qemu-system-aarch64: terminating on signal 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: https://spectrum-os.org/lists/archives/spectrum-devel/875xbl33vw.fsf@alyssa.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 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 = accept(listener, nullptr, nullptr)) == -1) { - perror("accept"); - exit(EXIT_FAILURE); - } - fputs("accepted connection!\n", stderr); - if (!(conn = fdopen(conn_fd, "r"))) { - perror("fdopen(server connection)"); - exit(EXIT_FAILURE); - } + for (;;) { + len = 0; - len = fread(msg, 1, sizeof msg, conn); - if (len != 6 || memcmp("hello\n", msg, 6)) { - if (ferror(conn)) - perror("fread(server connection)"); - else + fputs("waiting for server connection\n", stderr); + if ((conn = accept(listener, nullptr, nullptr)) == -1) { + perror("accept"); + exit(EXIT_FAILURE); + } + fputs("accepted connection!\n", stderr); + + for (;;) { + r = read(conn, msg + len, sizeof msg - len); + if (r == -1) { + perror("read"); + exit(EXIT_FAILURE); + } + if (r == 0) + break; + len += 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); } static void drain_connections(int listener) base-commit: 067c6a5d50971242f9cb8ac0ac76e20d88a9b5c1 -- 2.51.0