fix(daemon): on Linux a forward wall-clock step may make a live daemon's own lock read as stale

Đang mở
#156 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, linux
Lĩnh vực
operating-systems

Hướng nghiên cứu

Start in internal/daemon/procstart_linux.go, where processStartTime combines btime from /proc/stat with the start tick from /proc/<pid>/stat, and check the lock and registry staleness comparison that uses procStartTimeSlack. First confirm the wall-clock step effect by reading btime before and after a 10 s forward step on Linux. Done means either a corroboration check against the start tick count for same-boot records, or a documented limit next to procStartTimeSlack, with the fix confirmed in the daemon tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug priority:low
What happens

On Linux, processStartTime (internal/daemon/procstart_linux.go) works out a process's start time when it reads it: btime from /proc/stat plus the tick count from /proc/<pid>/stat. The kernel computes btime from the current wall-clock offset, so a step of the wall clock moves it. Two examples of such a step are an NTP step and a WSL2 resume.

After a forward step of more than procStartTimeSlack (5 s), a live daemon's own lock and registry record would read as stale. Another acquire would then remove the lock (INDX-05), and List would prune the record.

This is unconfirmed: it comes from reading the code, not from a reproduction. The problem predates #146. The #146 change narrows it, because after a backward step the record now corroborates.

To confirm
  1. On Linux, read btime from /proc/stat.
  2. Step the wall clock forward 10 s.
  3. Read btime again and compare.
What should happen

If this is confirmed, corroborate a record from the same boot against a value that a clock step does not move, for example the start tick count. Otherwise, document the limit next to procStartTimeSlack.

Refs #146.


🤖 Generated with Claude Code

https://claude.ai/code/session_017tyHwvTWuHuKjdiZLTaGD1

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của seanb4t/codegraph-go

Tất cả issue của seanb4t/codegraph-go

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.