Skip to content

vmm: fix migration sender hang on worker failure - #193

Merged
Coffeeri merged 2 commits into
cyberus-technology:gardenlinuxfrom
Coffeeri:fix/migration-sender-hang
Aug 19, 2026
Merged

vmm: fix migration sender hang on worker failure#193
Coffeeri merged 2 commits into
cyberus-technology:gardenlinuxfrom
Coffeeri:fix/migration-sender-hang

Conversation

@Coffeeri

@Coffeeri Coffeeri commented Aug 18, 2026

Copy link
Copy Markdown

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. In addition, once one of the workers sets worker_error, the other workers stop sending the queued memory chunks and drain the channel, so the Disconnects are queued and all workers exit.

Pipeline

cc @tpressure @phip1611

@Coffeeri
Coffeeri force-pushed the fix/migration-sender-hang branch from 847d8d8 to 630f7d5 Compare August 18, 2026 15:27
Comment thread vmm/src/migration_transport.rs Outdated
@Coffeeri
Coffeeri force-pushed the fix/migration-sender-hang branch from 630f7d5 to da54a33 Compare August 19, 2026 06:40
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 <leander.kohler@cyberus-technology.de>
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 <leander.kohler@cyberus-technology.de>
@Coffeeri
Coffeeri force-pushed the fix/migration-sender-hang branch from da54a33 to 07ed6a3 Compare August 19, 2026 08:19
@Coffeeri Coffeeri self-assigned this Aug 19, 2026

@phip1611 phip1611 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, thanks

Comment thread vmm/src/migration_transport.rs
@Coffeeri
Coffeeri merged commit 4fb29bc into cyberus-technology:gardenlinux Aug 19, 2026
19 checks passed
@Coffeeri
Coffeeri deleted the fix/migration-sender-hang branch August 21, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants