Automatically expire stale Pending node entries - #8173
Automatically expire stale Pending node entries#8173Amaury Chamayou (achamayou) with Copilot wants to merge 9 commits into
Conversation
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
b1a16f8 to
f8929e7
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Copilot resolve the merge conflicts in this pull request |
…-expire-pending-entries # Conflicts: # tests/e2e_operations.py Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Resolved in |
There was a problem hiding this comment.
🟡 Changes recommended
Timestamp throttling can expire active joiners early, while the default and changelog placement conflict with stated requirements.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds primary-driven expiration of stale Pending node records, including configuration, persistence, cleanup, documentation, and tests.
Changes:
- Records and refreshes Pending-node timestamps.
- Periodically removes expired nodes and associated data.
- Adds host configuration, documentation, and test coverage.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/changelog.instructions.md.github/instructions/reviewing.instructions.md
File summaries
| File | Description |
|---|---|
tests/infra/remote.py |
Passes timeout into node configuration. |
tests/infra/network.py |
Forwards the new test argument. |
tests/e2e_operations.py |
Tests automatic expiration end-to-end. |
tests/config.jinja |
Renders the timeout setting. |
src/node/rpc/test/node_stub.h |
Adds configurable test subsystems. |
src/node/rpc/test/node_frontend_test.cpp |
Tests timestamp and cleanup behavior. |
src/node/rpc/test/frontend_test.cpp |
Reuses the shared configuration stub. |
src/node/rpc/node_frontend.h |
Tracks timestamps and removes expired entries. |
src/node/pending_node_cleanup.h |
Implements periodic primary cleanup. |
src/node/node_state.h |
Starts the cleanup task. |
src/common/configuration.h |
Registers configuration serialization. |
include/ccf/service/node_info.h |
Persists the last-seen timestamp. |
include/ccf/node/startup_config.h |
Defines the timeout default. |
doc/operations/start_network.rst |
Documents expiration behavior. |
doc/host_config_schema/host_config.json |
Adds the host configuration schema. |
CHANGELOG.md |
Announces the feature. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const auto refresh_interval = | ||
| pending_node_timeout.value().count() / 2; | ||
| if ( | ||
| !node_info->pending_last_seen.has_value() || | ||
| node_info->pending_last_seen.value() < 0 || | ||
| node_info->pending_last_seen.value() > now || | ||
| now - node_info->pending_last_seen.value() >= refresh_interval) |
Co-authored-by: achamayou <4016369+achamayou@users.noreply.github.com>
Unsuccessful join attempts can leave Pending node records requiring manual operator cleanup. This adds configurable, primary-driven expiration.
Expiration
pending_node_timeout.Configuration
24h.0sto disable cleanup.{ "pending_node_timeout": "6h" }Compatibility
Integration