Skip to content

Fix stopped-peer ack checks and service load cleanup - #8526

Merged
Amaury Chamayou (achamayou) merged 5 commits into
mainfrom
achamayou-turbo-goggles
Oct 8, 2026
Merged

Amaury Chamayou (achamayou) merged 5 commits into
mainfrom
achamayou-turbo-goggles

Conversation

@achamayou

@achamayou Amaury Chamayou (achamayou) commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Motivation

The Coverage SNP Genoa run failed after an 882 ms ledger fsync delayed the post-election acknowledgement check. That check incorrectly required a fresh acknowledgement from the primary the test had deliberately stopped. Exception cleanup then left Locust running with inherited stdout, causing CTest to report a timeout instead of the test failure.

Implementation summary

  • Require fresh primary-side acknowledgements only from joined, running peers. Keep the live-peer election-timeout boundary and backup-side zero-age assertions unchanged.
  • Always end service load when its context exits, including exceptions. Join the polling thread before stopping its client so an in-flight restart cannot leave another Locust process behind.

No new tests, CI wiring, or documentation changes are included. Local formatting and lint checks passed for the final changed files; scripts/ci-checks.sh passed before the test-only additions were removed. The full nodes_test e2e command (cd build && ./tests.sh --timeout 360 --output-on-failure -R '^nodes_test$' --no-tests=error) was not run locally because this worktree has no configured build or built logging application; it remains covered by existing CI.

Safety and compatibility

Test code and infrastructure fixes only: no CCF runtime, consensus, API, ledger format, recovery, or mixed-version behaviour changes. The acknowledgement check still rejects stale live peers. Cleanup waits for the existing load worker to finish before terminating its subprocess, and test-body exceptions continue to propagate.

Check acknowledgement freshness only for joined live peers, and always clean up service load on context exit. Join its polling thread before terminating the client to avoid a shutdown/restart race. Add infrastructure regressions and run them in CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) requested a review from a team as a code owner October 7, 2026 21:33
Copilot AI balanced review requested due to automatic review settings October 7, 2026 21:33
Keep the PR focused on the stopped-peer acknowledgement and service-load cleanup fixes, as requested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Cleanup can mask the originating test failure when load shutdown or result rendering also raises.

1 open finding
What changed in this PR

Fixes stopped-peer acknowledgement checks and ensures service load cleanup runs on exceptions.

Changes:

  • Excludes stopped peers from primary acknowledgement freshness checks.
  • Stops and joins the load worker before terminating Locust.
  • Runs cleanup whenever the load context exits.

Custom instructions used:

  • CCF Repository Copilot Instructions
  • .github/skills/testing/SKILL.md
File Description
tests/​nodes.py Filters acknowledgement checks to joined, running nodes.
tests/​infra/​service_load.py Adds deterministic context and worker cleanup.

🧠 Review effort: Balanced


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

Comment thread tests/infra/service_load.py
Log shutdown errors when the load context is already unwinding a failure, then re-raise the original exception. Keep cleanup failures fatal on normal context exit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@achamayou
Amaury Chamayou (achamayou) merged commit 30e4052 into main Oct 8, 2026
12 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the achamayou-turbo-goggles branch October 8, 2026 14:25
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.

4 participants