Skip to content

Preserve PID locks during daemon status checks - #1181

Merged
matteius merged 4 commits into
mainfrom
ai-findings-autofix/src-core-daemon.c
Nov 26, 2026
Merged

matteius merged 4 commits into
mainfrom
ai-findings-autofix/src-core-daemon.c

Conversation

@matteius

@matteius matteius commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Findings addressed

  • Distinguish a running daemon from a PID-file inspection error in startup logging.
  • Preserve process-scoped PID locks during in-process status calls by checking the retained descriptor before opening the same file. External status calls still verify the lock; stale files do not report a running service merely because their PID was reused.
  • Add a regression test that verifies status does not release the lock and reports stopped after lock release.

Verification

Built lightnvr and test_config; all 81 config tests passed, including the new PID-lock test.

matteius and others added 3 commits November 26, 2026 03:27
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@matteius matteius changed the title Potential fixes for 2 code quality findings Preserve PID locks during daemon status checks Nov 26, 2026
@matteius
matteius marked this pull request as ready for review November 26, 2026 08:32
@matteius
matteius merged commit d0f4e9b into main Nov 26, 2026
3 checks passed
@matteius
matteius deleted the ai-findings-autofix/src-core-daemon.c branch November 26, 2026 08:33
@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.55556% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/daemon.c 75.55% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

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