Skip to content

fix: order watchdog receipts, close on failed replies, advertise real addresses - #128

Merged
gomaja merged 1 commit into
mainfrom
fix/i108d-watchdog-replies-addresses
Oct 15, 2026
Merged

gomaja merged 1 commit into
mainfrom
fix/i108d-watchdog-replies-addresses

Conversation

@gomaja

@gomaja gomaja commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Part 4, the last part, of the protocol contract decided in #108.

  • StateMachine's watchdog records receipts in order with their receipt
    time, in constant space: the newest activity and at most one DWA credit
    for the single outstanding DWR. Tw is rearmed from the receipt time, a
    DWA credit and the expiry decision are taken in one atomic step, and the
    window after a DWR starts when the DWR is actually published, so neither
    a backlog nor a slow write turns a healthy peer SUSPECT (RFC 3539
    §3.4.1, Appendix A).
  • Both front ends close the connection, once, when a required reply (CEA,
    DWA, DPA or an error answer) cannot be built, queued or written, and
    report the reply status in order: queued before failed.
  • CER and CEA advertise only configured or actually resolved addresses
    (RFC 6733 §5.3.5). The Manager no longer falls back to loopback when it
    cannot resolve one, so a custom transport may need Host-IP-Address
    configured; StateMachine still advertises loopback addresses that may
    really be used.

Fixes #108

Validation

  • make check passes locally for all modules: format, test (Go 1.27.2 and
    1.26.9), race, vet, lint, vuln, windows, secrets and codeql.
  • Fake-clock tests cover backlog, simultaneous timeout, activity and DWA, a
    stalled DWR write and a DWA admitted at the expiry boundary; TCP captures show
    no extra probe and no false SUSPECT, and CER/CEA advertising only real addresses.
  • Three review rounds found unbounded receipt storage, a response window started
    before the DWR was published, Queued/Failed reported out of order and a receipt
    versus expiry race; all are fixed with their own tests, and the watchdog tests
    pass under -race -count=20.

Summary by cubic

Fixes the final part of the protocol contract for #108: ordering watchdog receipts, closing on required-reply failures, and advertising real addresses.

Watchdog

  • Receipts are recorded in order with their receipt time, in constant space: the newest activity and at most one DWA credit for the single outstanding DWR.
  • Tw is rearmed from the receipt time, the DWA credit and expiry decision are atomic, and the window starts when the DWR is published, so neither a backlog nor a slow write marks a healthy peer SUSPECT.

Required replies and addresses

  • Both front ends close the connection once when a required CEA, DWA, DPA, or error answer cannot be built, queued, or written, and report queued before failed.
  • CER and CEA advertise only configured or actually resolved addresses; the Manager no longer falls back to loopback (custom transports may need Host-IP-Address configured), while StateMachine still advertises loopback addresses that may really be used.

Written for commit 5b947b1. Summary will update on new commits.

View guided diff Turn on auto-fix

… addresses

Part 4, the last part, of the protocol contract decided in #108.

- StateMachine's watchdog records receipts in order with their receipt
  time, in constant space: the newest activity and at most one DWA credit
  for the single outstanding DWR. Tw is rearmed from the receipt time, a
  DWA credit and the expiry decision are taken in one atomic step, and the
  window after a DWR starts when the DWR is actually published, so neither
  a backlog nor a slow write turns a healthy peer SUSPECT (RFC 3539
  §3.4.1, Appendix A).
- Both front ends close the connection, once, when a required reply (CEA,
  DWA, DPA or an error answer) cannot be built, queued or written, and
  report the reply status in order: queued before failed.
- CER and CEA advertise only configured or actually resolved addresses
  (RFC 6733 §5.3.5). The Manager no longer falls back to loopback when it
  cannot resolve one, so a custom transport may need Host-IP-Address
  configured; StateMachine still advertises loopback addresses that may
  really be used.

Fixes #108
Copilot AI balanced review requested due to automatic review settings October 15, 2026 07:44

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

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 ⚠️ Failed 2026-10-15T07:44:06.698803Z 5b947b1 PR opened
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b837fc0f-c2e4-479a-9e0b-4fd244bc0829
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@gomaja
gomaja merged commit 336a860 into main Oct 15, 2026
2 checks passed
@gomaja
gomaja deleted the fix/i108d-watchdog-replies-addresses branch October 15, 2026 07:48
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.

Core plan 1: specify the shared protocol contract and record StateMachine/Manager divergence

2 participants