Skip to content

fix: correct process start time in LXC - #13473

Merged
ssongliu merged 2 commits into
dev-v2from
fix/lxc-process-start-time
Aug 5, 2026
Merged

fix: correct process start time in LXC#13473
ssongliu merged 2 commits into
dev-v2from
fix/lxc-process-start-time

Conversation

@ssongliu

@ssongliu ssongliu commented Aug 5, 2026

Copy link
Copy Markdown
Member

Refs #13472

Copilot AI lite review requested due to automatic review settings August 5, 2026 03:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect process start times reported in LXC environments by introducing a resolver that falls back to computing create time from /proc/stat (btime) and /proc/<pid>/stat (starttime) when gopsutil yields an implausible (future) timestamp.

Changes:

  • Added ProcessCreateTimeResolver to normalize process create-time computation using /proc when needed (LXC skew workaround).
  • Updated process listing and PID-detail endpoints to use the new resolver instead of proc.CreateTime().
  • Standardized process StartTime formatting in the websocket process list output to YYYY-MM-DD HH:MM:SS.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
agent/utils/websocket/process_data.go Uses the new resolver for per-process StartTime in process listings and adjusts formatting.
agent/utils/psutil/process.go Introduces a create-time resolver with /proc-based fallback logic for LXC skew cases.
agent/go.mod Promotes go-sysconf to a direct dependency for clock tick discovery.
agent/app/service/process.go Uses the resolver for PID-detail StartTime to match the corrected logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agent/utils/psutil/process.go
Copilot AI review requested due to automatic review settings August 5, 2026 03:21
@ssongliu
ssongliu merged commit 01aee89 into dev-v2 Aug 5, 2026
4 checks passed
@ssongliu
ssongliu deleted the fix/lxc-process-start-time branch August 5, 2026 03:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants