#4971·lmdeploy

[错误] 月饼异步迁移可能永远卡死,导致 Decode 不可用

作者: JPengLi创建于 2026年9月15日更新于 2026年9月15日
  • LMDeploy v0.17.0
  • Source snapshot used for analysis: lmdeploy-main-src/lmdeploy-main

Relevant source path: lmdeploy/pytorch/disagg/backend/mooncake.py lmdeploy/pytorch/engine/engine_loop.py

Relevant control flow in mooncake.py:

python
async def p2p_migrate(self, assignment: MigrationAssignment, async_op: bool = False):
    if not LMDEPLOY_USE_ASYNC_MIGRATION:
        self._migrate(assignment)
    else:
        import asyncio
        loop = asyncio.get_event_loop()
        future = loop.create_future()

        await loop.run_in_executor(None, self._migrate, assignment)

        result = await future
        if result != 0:
            raise RuntimeError(f'Failed to perform async transfer: {result}')

The issue is that future is created but never completed. The executor result from _migrate() is not used to complete future, and there is no callback that calls future.set_result() or future.set_exception().

The Decode migration path calls this backend migration from engine_loop.py. Therefore, when Mooncake async migration is enabled, a normal Proxy request can enter the migration path, finish _migrate(), and then hang forever at await future.

Reproduction

内容来源: InternLM/lmdeploy