From 668ae86ace7359b6dc6d6e3d8ba36ff160269246 Mon Sep 17 00:00:00 2001 From: Leander Kohler Date: Tue, 18 Aug 2026 16:37:06 +0200 Subject: [PATCH 1/2] vmm: fix migration sender hang on worker failure A single failing parallel migration connection can deadlock the migration sender. When the bounded send-channel is full, `SendAdditionalConnections::cleanup()` silently drops the Disconnect messages via the non-blocking `try_send`. The surviving workers drain the channel and then block forever in `recv()`, while the main thread blocks forever in `join()`. The VM stays stuck in the "migrating" state. We fix this by sending the `Disconnect` messages with a blocking send, ensuring the messages reach the migration workers. On-behalf-of: SAP leander.kohler@sap.com Signed-off-by: Leander Kohler --- vmm/src/migration_transport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmm/src/migration_transport.rs b/vmm/src/migration_transport.rs index 95ea03b9fa..42c9017fff 100644 --- a/vmm/src/migration_transport.rs +++ b/vmm/src/migration_transport.rs @@ -885,7 +885,7 @@ impl SendAdditionalConnections { // All threads may have terminated, leading to a dropped receiver. Thus we ignore // errors here. self.message_tx - .try_send(SendMemoryThreadMessage::Disconnect) + .send(SendMemoryThreadMessage::Disconnect) .ok(); } From 07ed6a3707f34f3fba1ea32c459263eb009f6fb2 Mon Sep 17 00:00:00 2001 From: Leander Kohler Date: Tue, 18 Aug 2026 16:37:06 +0200 Subject: [PATCH 2/2] vmm: skip pending memory sends on worker failure When a memory-sending worker fails, the migration thread calls `SendAdditionalConnections::cleanup()`. Cleanup tries to enqueue one `Disconnect` message per worker, but the bounded channel may still contain `SendMemoryThreadMessage::Memory` values. The surviving workers currently call `send_memory_ranges()` for each such value, even though the migration has already failed. Skip that call when `worker_error` is set. This consumes the queued values without processing them and lets cleanup enqueue the `Disconnect` messages. On-behalf-of: SAP leander.kohler@sap.com Signed-off-by: Leander Kohler --- vmm/src/migration_transport.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmm/src/migration_transport.rs b/vmm/src/migration_transport.rs index 42c9017fff..dbaf785c02 100644 --- a/vmm/src/migration_transport.rs +++ b/vmm/src/migration_transport.rs @@ -727,7 +727,9 @@ impl SendAdditionalConnections { })?; match message { SendMemoryThreadMessage::Memory(table) => { - if external_cancel.load(Ordering::Acquire) { + if external_cancel.load(Ordering::Acquire) + || worker_error.load(Ordering::Acquire) + { continue; }