vsce-testing: orphaned `.drive-udd-*` dirs accumulate when a run never reaches teardown
Maintainer thường phản hồi trong vòng 8 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Bắt đầu trong scripts/vscode-drive.psm1 tại Start-VSCodeDrive, sau đó so sánh việc đối chiếu liveness trong Get-VSCodeWindow và Stop-VSCodeDrive. Xác minh rằng việc dọn dẹp chỉ nhắm đến các thư mục .drive-udd-* mồ côi, giữ lại các thư mục thuộc về các tiến trình đang hoạt động và không bao giờ quét .drive-extensions/; đồng thời xem xét vòng đời của drive để kiểm tra phần bao phủ try/finally được đề xuất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Start-VSCodeDrive mints a uniquely-named user-data dir per launch, and Stop-VSCodeDrive deletes it. The happy path is correct. But when a run never reaches teardown — agent interruption, crash, killed session, an exception between start and stop — the dir is orphaned and nothing ever reclaims it.
Found while reclaiming disk space on a dev machine: 21 orphaned .drive-udd-* dirs, 10–30 days old, in .github/skills/vsce-testing/.
Evidence
scripts/vscode-drive.psm1:
# L166 - new dir per launch
$udd = Join-Path $harness (".drive-udd-" + [guid]::NewGuid().ToString('N').Substring(0, 8))
# L516 - cleaned ONLY via Stop-VSCodeDrive
Remove-Item $Ctx.Udd -Recurse -Force -ErrorAction SilentlyContinue
There is no sweep at start, and no try/finally guaranteeing teardown, so the cleanup is reachable only on the path that completes normally.
Impact
Low severity, unbounded growth. The 21 orphans totalled ~50 MB, but two of them were ~22 MB each — size depends on how far the VS Code instance got before dying, so a run that loaded the C# extension leaves a much bigger dir. On a machine running this skill regularly it grows without limit, and it is invisible because the dirs are gitignored (.gitignore:4).
Suggested fix
Defensive sweep in Start-VSCodeDrive: before creating the new dir, remove any existing .drive-udd-* in the harness whose leaf name does not appear in the command line of a live process. The liveness check already exists — Get-VSCodeWindow (L218) and Stop-VSCodeDrive (L513) both match CommandLine against the udd leaf, so the same predicate can be reused. That makes cleanup self-healing without risking a dir belonging to a concurrently running instance.
Worth pairing with a try/finally around the drive lifecycle so normal exceptions still hit teardown.
Notes
- Pre-existing on
main; unrelated to any open PR. - The
.drive-extensions/dir is a different case and should not be swept — it is an intentional cross-run cache of installed extensions.
- Ngôn ngữ chính
- TypeScript
- Star
- 15
- Fork
- 4
- Merge trung bình
- 7 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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 microsoft/WinAppVSCE
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/WinAppVSCE#320 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/WinAppVSCE#262 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
[Feature]: Update WinUI templates to include launch.json + VSCE RecommendationCó thể đã có người làm @chiaramooney đã nhận 16 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/WinAppVSCE#219 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 8 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/WinAppVSCE#160 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/WinAppVSCE#159 ·
Maintainer thường phản hồi trong vòng 8 ngày
Tất cả issue của microsoft/WinAppVSCE
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
JuliusBrussee/caveman#1449 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
linagora/twake-calendar-frontend#1924 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Class TV ModaĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
libnativeapi/nativeapi#21 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
GiganticMinecraft/seichi-playguide#183 ·
Maintainer thường phản hồi trong vòng 1 ngày