From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=C79w12AG; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 8CD3D5A062D for ; Thu, 13 Feb 2025 13:14:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1739448860; bh=49jsmn/Kzq7Cop7uZu+Vh6hiN193nPukkmkdAXJova4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C79w12AGH97xGVhwYIljrEnJcDiXzZ/wkGiCkjmt+i+JAavu2Y94dnH953HssGOUP Ol7RdWTVEaZ2FntqmX/L4sRMEwyUxjEmlYIprpgQhFjnZeIDcKAVFceemXoBhBE15i 0k5OXCDHw2tfRbvNdZYmQ62PzAJi1CqXS3kmQ15Ypig/NuIsrjeS224f8HVnMV5LDK n0XgJqvMWMUe56lbJn6y0o4Ymsxm9Xk1pe4E7CWULJ8DEVZIL3TSabfvg7Z3OAIgwS v7M/VXUpQGBVftiMpdXezVrpmGoCD1JQAbYCkkiTXlnLusPMJBDda2HE80rf9dgv4G 0d2yUWCxVc06A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YtvHc2lRVz4x3q; Thu, 13 Feb 2025 23:14:20 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v21 4/5] fixup?: Don't fail whole migration for errors restoring sndq Date: Thu, 13 Feb 2025 23:14:16 +1100 Message-ID: <20250213121417.617970-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213121417.617970-1-david@gibson.dropbear.id.au> References: <20250213121417.617970-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: MNQSQPOGHS5VZFZMD3BB76BCYDTG7YNV X-Message-ID-Hash: MNQSQPOGHS5VZFZMD3BB76BCYDTG7YNV X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This seems to sometimes fail with EAGAIN for unclear reasons. We've already read all the data from the state stream, so just kill the flow on the target and carry on to the next. Signed-off-by: David Gibson --- tcp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tcp.c b/tcp.c index 2a64b7c5..80a2eb5e 100644 --- a/tcp.c +++ b/tcp.c @@ -3540,10 +3540,16 @@ int tcp_flow_migrate_target_ext(struct ctx *c, union flow *flow, int fd) err("socket %i, t.sndq=%u t.notsent=%u", s, t.sndq, t.notsent); - if ((rc = tcp_flow_repair_queue(s, t.notsent, - tcp_migrate_snd_queue + - (t.sndq - t.notsent)))) - return rc; + if (tcp_flow_repair_queue(s, t.notsent, + tcp_migrate_snd_queue + + (t.sndq - t.notsent))) { + /* This sometimes seems to fail for unclear reasons. + * Don't fail the whole migration, just reset the flow + * and carry on to the next one. + */ + tcp_rst(c, conn); + return 0; + } } /* If we sent a FIN but it wasn't acknowledged yet (TCP_FIN_WAIT1), send -- 2.48.1