Harden VMM lifecycle consistency across update, reload, and removal
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- rust
- Lĩnh vực
- backend, infrastructure
Hướng nghiên cứu
Bắt đầu bằng việc xác định các entry point của UpdateVm, reload, removal, lifecycle serialization, manifest, disk-resize và CID-allocation được mô tả trong issue. Trước tiên, hãy lần theo các đường dẫn thay đổi và khôi phục của chúng, sau đó xác định hành vi nhất quán và thêm các bài kiểm thử chèn lỗi cũng như kiểm thử thao tác đồng thời, bao quát việc ghi một phần, tái sử dụng CID, các cuộc đua giữa reload/removal và khôi phục sau khi khởi động lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
VMM lifecycle operations update files, disk metadata, in-memory state, the CID pool, and supervisor processes across multiple steps. These steps are not consistently validated, serialized, or rolled back.
Review of #766 exposed the following independent issues. They are not part of the no-TEE feature and should be addressed separately.
Findings
UpdateVmwrites the compose file, encrypted environment, and user config before later resource and manifest operations complete. A later failure leaves a partial update.- Disk resize occurs before manifest persistence and VM reload. A later failure can leave the qcow2 virtual size inconsistent with the manifest.
- Manifest writes use a direct file write, so interruption can leave a truncated manifest.
storage_fsis derived from the image command line and app compose on each load. Changing either can change the expected filesystem for an existing disk.- Start, stop, update, reload, and removal are not serialized per VM. Concurrent operations can observe or overwrite intermediate state.
- Reload rebuilds CID occupancy from running supervisor processes but does not preserve CIDs owned by stopped in-memory VMs. A new VM can reuse an existing CID. Supervisor processes excluded by annotation parsing may also fail to reserve their CIDs.
- User removal awaits port-forward cleanup after writing
.removingbut before spawning background cleanup. Cancellation of the RPC future can leave removal marked but not progressing until reload or restart. - Orphan cleanup and reload can race: cleanup may finalize after reload has recreated state for the same VM and CID.
The existing .removing marker already provides restart recovery and should remain the durable source of removal intent.
Suggested direction
- Validate the complete update before the first mutation.
- Define transactional file and disk update behavior, including rollback or an ordering that cannot expose inconsistent state.
- Serialize lifecycle operations per VM and define lock ordering for reload and CID allocation.
- Rebuild CID ownership from both supervisor state and loaded stopped VMs, rejecting ownership conflicts.
- Spawn removal cleanup before the RPC can be cancelled, while preserving
.removingrecovery. - Add failure-injection and concurrent-operation tests for partial writes, disk resize failure, CID reuse, reload/removal races, and process restart.
Context
These findings came from review of #766. The experimental fixes were removed from that PR to keep it scoped to development-only no-TEE support.
- Ngôn ngữ chính
- Rust
- Star
- 546
- Fork
- 96
- Merge trung bình
- 19 giờ 22 phút
- Pull request đã merge (30 ngày)
- 109
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Dstack-TEE/dstack
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
Dstack-TEE/dstack#1301 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Dstack-TEE/dstack#1300 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Dstack-TEE/dstack#1299 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Dstack-TEE/dstack#1298 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Dstack-TEE/dstack#1297 ·
Tất cả issue của Dstack-TEE/dstack
Issue tương tự
-
risk:low runtime status:in-progress type:test
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
EricSpencer00/Resilient#4835 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cesarferreira/stax#890 ·