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 982D31F30A; Sat, 29 Nov 2025 18:00:54 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 174071F2D8; Sat, 29 Nov 2025 18:00:52 +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 fout-b7-smtp.messagingengine.com (fout-b7-smtp.messagingengine.com [202.12.124.150]) by atuin.qyliss.net (Postfix) with ESMTPS id B64731F277 for ; Sat, 29 Nov 2025 18:00:50 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id E39261D001E8; Sat, 29 Nov 2025 13:00:47 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Sat, 29 Nov 2025 13:00: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=1764439247; x=1764525647; bh=cLg/q63Gu8f5O3KmLZ3uP N9UI1Anuapzonp6tWyrP0g=; b=Oi/AheTLl01plCUip356caqjHyOcVj1RnUZX4 Xf1Kl1zwgVg/PIc3AKjDM20kqdcD049kdG7NNnPgF6mYwBcLnCyayM6mKlWauKZ6 i/N3U4j69Zbl4pC/7yEHKkTgkkjc+9ibxSW6eazxyu4fxm7gzMdHocWZq6XNbHJ+ Rt4zlIjTU2sz0rsNyBg38n25I9EzRvM/ZDCpVpVGMm/pHT3+iwIy/tVL7HyETR3g HLwlvRaq9EPJk/yVipEFCV5usZDfle1PWRk8qrO/n83hOdKqzopEAc+bq1n6MrCv CFnd1b5ea3g7rwxN3gCQJlmB6HRTeeN1bHeZkUAYA3//4QFHw== 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= 1764439247; x=1764525647; bh=cLg/q63Gu8f5O3KmLZ3uPN9UI1Anuapzonp 6tWyrP0g=; b=TrMizEvQHw4BYoAnCnwYlgwYw1GnlFtwxpt6d5Hl2osGfNH/tRN tmhwmD/0kugbD/MiYoB74OjJCnYGn2H4y7dpR/pcsct3Q3O1EGUm+PX58xEj66Ya ++jctQfqDBPX6vxW5C++/OfuMN+HauIaSg2qRMZIvZqIYeDhgvc1kU3J/VmYL67P 7TD3ugT4b/M9akc4K+H61koSqVDIuQJ+8rwSPu6LDJ0E6ic0p71SBkR8FkA03ZzA ZZMJJmTKG1wqQbbD51FX7uT4tYdeKWA2q07EfJA/NAFlfSvGjbWbwJJma0PWA8jR R0bOgvf2AVXC1N6Z6Qn+W4QM8vpctxqRoCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvheefuddvucetufdoteggodetrf 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 13:00:46 -0500 (EST) Received: by fw12.qyliss.net (Postfix, from userid 1000) id 190C831BC326; Sat, 29 Nov 2025 19:00:45 +0100 (CET) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v2] release/checks/integration: handle partial sends Date: Sat, 29 Nov 2025 19:00:17 +0100 Message-ID: <20251129180016.3895-2-hi@alyssa.is> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 6YHYJDN6T3ATE6BRWQRTASGVVBA33K36 X-Message-ID-Hash: 6YHYJDN6T3ATE6BRWQRTASGVVBA33K36 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 --- v2: close connections when finished reading. v1: https://spectrum-os.org/lists/archives/spectrum-devel/20251129163521.717709-2-hi@alyssa.is/ release/checks/integration/networking.c | 50 +++++++++++++++---------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/release/checks/integration/networking.c b/release/checks/integration/networking.c index 97d7895..df76ec5 100644 --- a/release/checks/integration/networking.c +++ b/release/checks/integration/networking.c @@ -57,32 +57,44 @@ 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; + } + close(conn); + + 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