fix: a snapshot of a shared store handle is not tied to the user that took it
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in internal/graphstore/shared.go, where one Pebble handle is shared per store path, then read Snapshot() and Close() in internal/graphstore/pebble_store.go around lines 331, 354 and 489. Settle the open choice between per-user reader counting and the rule in design.md D1 that each user closes its readers first, using review note inv-1 in openspec/changes/archive/2026-11-11-shared-store-handle/review.md. Done means a two-user test through graphstore.Open where the non-final Close reports its own open snapshot.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
graphstore shares one Pebble handle for each store path in a process (internal/graphstore/shared.go). Snapshot() returns a pebbleReader that holds only its Pebble snapshot (internal/graphstore/pebble_store.go:331). The reader has no link to the store that created it.
pebbleReader.Close releases its snapshot (pebble_store.go:489). pebbleStore.Close returns nil while other users still hold the handle (pebble_store.go:354). A snapshot that one user leaks stays open until the last user closes the handle. Pebble then reports the leak on that last user's Close, not on the user that leaked it.
Review note inv-1 in openspec/changes/archive/2026-11-11-shared-store-handle/review.md records this. Every production caller closes its snapshot first today, so this is a latent defect, not a present one.
What you expected instead
The leak error must land on the user that took the snapshot. A Close that is not the last one must report its own open readers.
Whether the store counts open readers per user, or D1 in design.md states that each user closes its readers first, is open. Either choice needs a test with two users, where one closes with an open snapshot.
Steps to reproduce
Found by code reading. No test in the tree covers this case.
- Open one store path twice in one process with
graphstore.Open. Name the handlesfirstandsecond. - Call
first.Snapshot()and keep the reader open. - Call
first.Close(). It returns nil. - Call
second.Close(). Pebble reports the open snapshot here.
Version
Not from a release build. Found on main at c6788f5d, after #282 merged.
Platform
Darwin 27.2.0 (macOS). The architecture was not recorded.
How did you install it?
Other
Found in review of #282, not from an install.
Languages in the affected repository
Not applicable. The defect is in the Go store, not in language extraction.
Before submitting
- I searched existing issues and this is not a duplicate
- I checked the capability matrix and this is not a documented limitation
- This is not a security vulnerability
Related: #282 added the shared handle, and review note inv-1 names this defect.
🤖 Generated with Claude Code
- Ngôn ngữ chính
- Go
- Star
- 0
- Fork
- 0
- Merge trung bình
- 7 giờ 42 phút
- Pull request đã merge (30 ngày)
- 111
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 seanb4t/codegraph-go
-
chore needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
seanb4t/codegraph-go#380 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
seanb4t/codegraph-go#379 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query chore needs-triage spec-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
seanb4t/codegraph-go#377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
seanb4t/codegraph-go#362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:query bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
seanb4t/codegraph-go#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của seanb4t/codegraph-go
Issue tương tự
-
Add iterate GmbH domains to a dedicated list and include it in company and developer categoriesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
v2fly/domain-list-community#4307 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mattabate/life-distributable#232 ·
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 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày