git calls in the tree/file-browser crash with ENOBUFS on large repos
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- git, node.js, typescript
Hướng nghiên cứu
Bắt đầu trong dist/index.js, tại các lệnh gọi git được getTreeEntries, getTreeFingerprint, git status --porcelain -u và git rev-parse --show-toplevel sử dụng. Tái hiện với một repository có các đường dẫn được theo dõi vượt quá 1 MB bằng git ls-files | wc -c, sau đó chạy diffity tree hoặc /api/tree. Hoàn tất khi các repository lớn không còn tạo ra ENOBUFS hoặc phản hồi 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
Open diffity tree (or any tour view) on a large repo and the whole UI goes down with:
Something went wrong
Failed to get tree: Error: spawnSync git ENOBUFS
/api/tree returns a 500. Since the SPA surfaces that at the top level, views that don't even need the file tree (a code tour) go down with it too.
What I found
The git calls behind the file browser run through execFileSync("git", [...], { encoding: "utf-8" }) with no maxBuffer, so they get Node's 1 MB default. Once git ls-files prints more than 1 MB of paths, the call throws ENOBUFS. In 0.9.5's dist/index.js it's the git ls-files calls in getTreeEntries and getTreeFingerprint, the git status --porcelain -u, and the git rev-parse --show-toplevel calls.
How to reproduce
Any repo whose tracked paths exceed ~1 MB of text. Mine is a monorepo that vendors a few external repos as git subtrees, so git ls-files is ~14,300 files / 1.24 MB, just over the line. A large public repo would do the same.
git ls-files | wc -c # > 1048576 reproduces it
Environment
- diffity 0.9.5
- node (system), macOS arm64
- Ngôn ngữ chính
- TypeScript
- Star
- 775
- Fork
- 57
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 nilbuild/diffity
-
Local Storage for state Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
-
suggestion: diffity-server Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
-
LSP for typescript Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Tất cả issue của nilbuild/diffity
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100