Skip to content

fix(cli): preserve delayed event-watch cleanup marker - #409

Merged
3esmit merged 2 commits into
mainfrom
3esmit/fix-399-watch-cleanup-grace
Sep 16, 2026
Merged

3esmit merged 2 commits into
mainfrom
3esmit/fix-399-watch-cleanup-grace

Conversation

@3esmit

@3esmit 3esmit commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #399.

The CLI backup event-watch cleanup could force-kill the watcher process group after the 250 ms grace period, before a TERM trap completed under scheduler load. That removed the watch-stopped evidence and caused intermittent shutdown assertion failures.

Verification

  • cargo fmt --all
  • cargo fmt --all -- --check
  • cargo test --locked --lib modules::logos_core --no-fail-fast (84 passed)
  • cargo test --locked --test cli_backup --no-fail-fast (10 passed)
  • python3 scripts/check-build-pipeline.py ci (passed)
  • Concurrent stress: 8 workers × 50 runs with the 1 second bound (0 failures); the old bound reproduced marker loss.

Copilot AI lite review requested due to automatic review settings September 15, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T16:04:38.168402Z 15a5b6e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5154326909

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cli_backup.rs
#[test]
fn cli_backup_download_signal_cleanup_allows_delayed_watch_exit() -> Result<()> {
use nix::sys::signal::Signal;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Give the delayed test a unique service instance ID

When Linux tests run in parallel, this call duplicates the existing failed-cleanup test's (SIGTERM, false) inputs, while assert_cli_backup_signal_cleanup derives instance_id only from the signal, cleanup outcome, and shared test-process PID. Both tests therefore use the same /tmp/logos_core_service_* file, and either test's RemoveFileOnDrop can unlink it before the other child reads its metadata, causing an unrelated intermittent pre-dispatch failure. Include the delay/test variant or another unique value in the instance ID.

Useful? React with 👍 / 👎.

@3esmit
3esmit force-pushed the 3esmit/fix-399-watch-cleanup-grace branch 3 times, most recently from 560a9e2 to 1f7e675 Compare September 16, 2026 15:49
Cancellation can return execution cleanup uncertainty before the supervisor adds its shutdown wrapper. Accept either explicit path while retaining transport cancellation and watcher evidence requirements.

Add deterministic captured-message coverage and negative controls for both wrappers. Keep the watch-stopped marker, process-group cleanup, shutdown bounds, remote cancellation, staging, and state assertions unchanged.

Validation: cargo fmt --all; cargo fmt --all -- --check; all 9 CLI backup tests; 100 traced signal-cleanup repetitions; python3 scripts/check-build-pipeline.py ci (passed, including 1342 QML tests).

Refs #399. The original missing watch-stopped marker remains under investigation; this test-only change does not claim a runtime shutdown fix.
@3esmit
3esmit force-pushed the 3esmit/fix-399-watch-cleanup-grace branch from 1f7e675 to 15a5b6e Compare September 16, 2026 16:02
@3esmit
3esmit merged commit fd0af16 into main Sep 16, 2026
9 checks passed
@3esmit
3esmit deleted the 3esmit/fix-399-watch-cleanup-grace branch September 16, 2026 16:17
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.

test(cli): investigate intermittent backup event-watch cleanup failure

2 participants