Commit a619065
CA-273775: improve error handling in VM_receive_memory
Originally, once vm-migrate reached synchronisation point 1, there was only
one thread to kill in the receiving end in case VM_create or VM_restore
failed (the main memory-receiving thread in created in receive_memory).
After the vgpu-migration support, once vm-migrate reaches synchronisation
point 1, two threads will have been created in the receiving host:
1) receive_memory: the original one receiving the main memory
2) receive_vgpu: a new one receiving the vgpu memory, created when the
sending host accessed the url /migrate-vgpu/ on the receiving host.
In the receive_vgpu thread in the receiving host, if some exception occurs
while executing VM_create or VM_restore, only the main memory thread will be
killed automatically, and the receive_vgpu thread will leak (will never end).
This patch kills the receive_vgpu thread if an exception in the receive_memory
thread occurs while the receive_vgpu thread is active, preventing this leak.
It uses the `finally` clause to execute VM_create and VM_restore, and then
instruct the receive_vgpu thread to disappear regardless if VM_create/restore
succeeded or raised an exception.
Signed-off-by: Marcus Granado <[email protected]>1 parent b4d86f2 commit a619065
1 file changed
+27
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1680 | 1680 | | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1693 | 1710 | | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | 1711 | | |
1707 | 1712 | | |
1708 | 1713 | | |
| |||
0 commit comments