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(a)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 -- 2.48.1