public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v21 4/5] fixup?: Don't fail whole migration for errors restoring sndq
Date: Thu, 13 Feb 2025 23:14:16 +1100	[thread overview]
Message-ID: <20250213121417.617970-5-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20250213121417.617970-1-david@gibson.dropbear.id.au>

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 <david@gibson.dropbear.id.au>
---
 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
-- 
@@ -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


  parent reply	other threads:[~2025-02-13 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-13 12:14 [PATCH v21 0/5] State migration David Gibson
2025-02-13 12:14 ` [PATCH v21 1/5] migrate: Migrate TCP flows David Gibson
2025-02-13 12:14 ` [PATCH v21 2/5] test: Add migration tests David Gibson
2025-02-13 12:14 ` [PATCH v21 3/5] fixup: TCP_REPAIR_WINDOW before send unsent David Gibson
2025-02-13 12:14 ` David Gibson [this message]
2025-02-13 12:14 ` [PATCH v21 5/5] debug David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250213121417.617970-5-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).