Skip to content

Conversation

@rsafrono
Copy link
Collaborator

@rsafrono rsafrono commented Jan 12, 2026

When Grout was working as a systemd service (rather than starting again for each test), shutdown_test did not work as expected.

Summary by CodeRabbit

  • New Features

    • Graceful shutdown mechanism for the grout service with signal handling and shutdown verification
    • Systemd integration so grout can be managed via service manager with main PID handling
    • Default tracing initialization for diagnostic purposes on non-standard runs
  • Refactor

    • Consolidated shutdown test flow to use a single unified shutdown routine, simplifying process management

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

Adds a new shutdown_grout function in smoke/_init.sh to gracefully stop grout whether run directly or managed by systemd (using pgrep or systemctl show --property=MainPID), waits or verifies shutdown via journalctl, removes grcli cleanup usage, and adds a default case to enable grcli tracing for non-matching script names. Updates smoke/shutdown_test.sh to call shutdown_grout instead of performing inline kill/wait and post-shutdown cleanup.


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c44cc9 and 16f48ee.

📒 Files selected for processing (2)
  • smoke/_init.sh
  • smoke/shutdown_test.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • smoke/shutdown_test.sh
🧰 Additional context used
📓 Path-based instructions (1)
**/*.sh

⚙️ CodeRabbit configuration file

**/*.sh: - Don't bother about unquoted shell variables.

Files:

  • smoke/_init.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build-and-tests (gcc-13, none, debugoptimized, ubuntu-24.04, -Dfrr=enabled, false)
  • GitHub Check: build-and-tests (clang-18, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: build-and-tests (gcc-14, address, debug, ubuntu-24.04, -Dfrr=enabled, true)
  • GitHub Check: build-and-tests (clang-15, none, debugoptimized, ubuntu-22.04, false)
  • GitHub Check: build-and-tests (clang-16, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: deb
  • GitHub Check: rpm
🔇 Additional comments (1)
smoke/_init.sh (1)

219-234: LGTM!

The alternate PID acquisition path via systemctl show for service mode and the new shutdown_grout function are implemented correctly. The function properly handles both execution modes:

  • Direct runs: waits for the child process
  • Service mode: adds restart to cleanup, verifies shutdown via journalctl, and removes stale grcli commands

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @smoke/_init.sh:
- Around line 229-230: The journalctl check is unreliable because it reads the
last 2 system-wide entries; change the check that currently uses "journalctl -n
2 | grep -q 'Deactivated successfully'" to query the grout service unit (use the
service/unit name) and increase the number of lines searched (e.g., -n 50) so
the grep reliably finds "Deactivated successfully"; keep the existing fail
invocation (fail "shutdown was not successful") but update the journalctl
invocation reference in the script to include --unit=<grout-unit-name> (or -u
<grout-unit-name>) and a larger -n value.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c10bc6 and 5c44cc9.

📒 Files selected for processing (2)
  • smoke/_init.sh
  • smoke/shutdown_test.sh
🧰 Additional context used
📓 Path-based instructions (1)
**/*.sh

⚙️ CodeRabbit configuration file

**/*.sh: - Don't bother about unquoted shell variables.

Files:

  • smoke/_init.sh
  • smoke/shutdown_test.sh
🧬 Code graph analysis (1)
smoke/shutdown_test.sh (1)
smoke/_init.sh (1)
  • shutdown_grout (223-234)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build-and-tests (gcc-13, none, debugoptimized, ubuntu-24.04, -Dfrr=enabled, false)
  • GitHub Check: build-and-tests (clang-15, none, debugoptimized, ubuntu-22.04, false)
  • GitHub Check: build-and-tests (gcc-14, address, debug, ubuntu-24.04, -Dfrr=enabled, true)
  • GitHub Check: build-and-tests (clang-18, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: build-and-tests (clang-16, none, debugoptimized, ubuntu-24.04, false)
  • GitHub Check: rpm
  • GitHub Check: deb
🔇 Additional comments (2)
smoke/shutdown_test.sh (1)

34-34: LGTM!

Clean delegation to the centralized shutdown_grout function.

smoke/_init.sh (1)

219-221: LGTM!

Correct approach to retrieve the main PID of a systemd-managed grout instance.

When Grout was working as a systemd service (rather than starting
again for each test), shutdown_test did not work as expected.
@rsafrono rsafrono force-pushed the fix_shutdown_test_for_service branch from 5c44cc9 to 16f48ee Compare January 12, 2026 13:44
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