Skip to content

lockFile leaks a goroutine and a lock on timeout #3109

Open

Description

@mikeland73

Severity (from the audit): Low

  • Where: internal/services/manager.go:391-412.
  • Cause: flock runs in a goroutine that sends on an unbuffered channel. After the 5s timeout the caller closes the file and returns, so the goroutine blocks forever, or takes a lock on a file descriptor that has been closed and possibly reused.
  • Fix: Use a buffered channel, or LOCK_NB with a retry loop until the deadline.

Found by an automated code audit, listed as finding #31 in specs/bug-checks.md (#3061). Line numbers refer to commit f7d01a7.

Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions