Skip to content

fix(lock): validate process identity using create time#141

Merged
olalie merged 2 commits into
mainfrom
feat/lock-validation
Jun 26, 2026
Merged

fix(lock): validate process identity using create time#141
olalie merged 2 commits into
mainfrom
feat/lock-validation

Conversation

@olalie

@olalie olalie commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

Prevent false detection of a running TapMap instance when an operating system reuses a PID.

Changes

  • Store the lock file as JSON
  • Store both the process PID and creation time
  • Validate the running process using PID and create_time
  • Automatically replace stale or invalid lock files
  • Add tests covering the lock validation logic

Motivation

The previous implementation identified a running instance using only the PID. Since operating systems may reuse PIDs after a process exits, a stale lock file could incorrectly prevent TapMap from starting. Using the process creation time ensures that the lock file refers to the original process instance.

@olalie olalie merged commit 77b59ea into main Jun 26, 2026
6 checks passed
@olalie olalie deleted the feat/lock-validation branch June 26, 2026 22:26
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.

1 participant