Skip to content

Exit when lightningd fails before RPC startup - #2

Open
satwise wants to merge 1 commit into
getumbrel:masterfrom
satwise:fix/exit-when-lightningd-dies
Open

satwise wants to merge 1 commit into
getumbrel:masterfrom
satwise:fix/exit-when-lightningd-dies

Conversation

@satwise

@satwise satwise commented Sep 22, 2026

Copy link
Copy Markdown

Summary

  • replace the indefinite inotifywait --monitor startup block with a bounded wait loop
  • detect when lightningd exits before creating lightning-rpc and propagate its exit status
  • add regression coverage for early daemon failure and normal RPC startup
  • run the lifecycle test in the existing image CI workflow

This allows the Core Lightning app's existing restart: on-failure policy to recover from transient Bitcoin RPC startup failures instead of leaving a wrapper-only container reported as running.

Fixes #1

Testing

bash -n docker-entrypoint.sh tests/docker-entrypoint-test.sh
bash tests/docker-entrypoint-test.sh
git diff --check

Copilot AI lite review requested due to automatic review settings September 22, 2026 17:08

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 review overview

🟡 Changes recommended

Moderate findings remain for watcher failure handling and regression-test coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates Docker startup handling so early lightningd failures propagate and containers can restart automatically.

Changes:

  • Replaces indefinite RPC monitoring with bounded polling.
  • Adds lifecycle regression tests.
  • Runs the tests in Docker CI.
File Summary
tests/​docker-entrypoint-test.sh Tests early failure and normal startup lifecycles.
docker-entrypoint.sh Detects early daemon exits and propagates status.
.github/​workflows/​docker.yml Runs entrypoint lifecycle tests in CI.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +27 to +31
cat >"$test_dir/bin/inotifywait" <<'EOF'
#!/usr/bin/env bash
sleep 0.05
exit 2
EOF
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.

Container stays running when lightningd exits before RPC is ready

2 participants