Skip to content

fix(relay): bound each cross-node delivery attempt - #9305

Merged
brow merged 2 commits into
mainfrom
fanout-attempt-timeout
Nov 12, 2026
Merged

brow merged 2 commits into
mainfrom
fanout-attempt-timeout

Conversation

@brow

@brow brow commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Context: #9302 (merged) stopped the relay from closing connections when cross-node fan-out falls behind. It also removed the 30 s delivery deadline. This PR is the fix from the review of #9302.

Problem: Since #9302, a fan-out worker waits for the access-gate database read with no time limit. If a database connection stops answering in the middle of that read, the worker never continues. Its queue fills, and one sixteenth of the node's channels get no live events from other nodes until the relay restarts. Before #9302 the deadline cut that delivery off after 30 s.

Fix: Each delivery attempt has a 30 s limit (MAX_DELIVERY_ATTEMPT), measured from when the worker starts it. When the limit passes, the relay counts the event in buzz_multinode_fanout_dropped_total{reason="stale"}, resyncs the artifact syncs the event matched, and continues with the next event. It closes no connection. An event that only waits in the queue is still delivered late, as #9302 intends. The queue-full drop and the new stale drop share one helper.

Validation

  • Added test: hung_delivery_is_dropped_at_the_bound_and_the_worker_moves_on drives the production worker with a database that accepts the connection and never answers. It checks that the delivery stops at the limit, is counted, resyncs the matched sync, closes nothing, and that the next event on the same worker is delivered. With the limit removed it fails (the worker waits out the pool's one-hour acquire timeout instead).
  • The other handlers::multinode_fanout tests pass. The full local buzz-relay suite was not run; CI on this head covers it.

🤖 Generated with Claude Code

@brow

brow commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T02:58:36.936274Z 296ee2f Draft marked ready
ℹ️ 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.

Base automatically changed from elrond/fanout-no-lag-close to main November 9, 2026 22:01
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 68363a6496

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A fan-out worker awaited the access-gate read with no limit, so a
database connection that stopped answering held the worker forever and
its channels got no cross-node live events until a restart. Cut each
attempt off after 30 s from when the worker starts it: count it as
dropped (reason=stale), resync the syncs it matched, close nothing and
keep draining.

Signed-off-by: Tom Brow <[email protected]>
@brow
brow force-pushed the fanout-attempt-timeout branch from 68363a6 to 3f00a61 Compare November 9, 2026 22:03
@brow
brow marked this pull request as ready for review November 12, 2026 02:56
@brow
brow requested a review from a team as a code owner November 12, 2026 02:56
@brow
brow enabled auto-merge (squash) November 12, 2026 02:56
@brow
brow deployed to codex-review November 12, 2026 02:57 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 12, 2026
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: 4c60be6a1e8dc2c7839f7c0294391fb93941ed9f...296ee2f1957afa29349d79051a6ba7d8d2257f2c
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete regressions found in the authorized PR range after tracing timeout cancellation, access checks, community scoping, cache updates, and artifact resync handling.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review used read-only source and history inspection. Builds and tests were not executed.

Generated by Codex Security Review |
Requested by: @brow |
Workflow run

@kazemek21 kazemek21 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.

Kyle reviewed this PR and the Nexus review-tracker notes and approved with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez.

@brow
brow merged commit 1b190d2 into main Nov 12, 2026
117 checks passed
@brow
brow deleted the fanout-attempt-timeout branch November 12, 2026 05:10
ravarora2 pushed a commit that referenced this pull request Nov 12, 2026
…small

* origin/main:
  fix(db): seek replaceable heads by channel (#9147)
  buzz-db: check events created_at floor in app writers (phase 1) (#8325)
  fix(mobile): keep a thread tail behind the keyboard unread (#9295)
  fix(mobile): restore header cues and per-channel identity check for #9369 (#9370)
  fix(relay): treat empty filter sets as match-nothing in SQL (#9342)
  buzz-cli: add --before and --before-id to messages search (#9382)
  feat(relay): agents cannot write in DMs except with their owner (#9371)
  fix(relay): bound each cross-node delivery attempt (#9305)
  feat(mobile): add iOS Home Screen shortcuts for New chat, New DM and the Bestie (#9360)
  perf(mobile): stop downloading whole videos for posterless stills (#9367)
  Enforce single-community relay mode (#9149)
  fix(relay): match #a tag filters in SQL before LIMIT (#9339)
  Add participant avatars to mobile conversation headers (#9369)
  fix(mobile): stop asking for an API token when the channel list is refused (#9327)
  chore(release): release Buzz Relay version 0.3.0 (#9362)
  Fix gallery video selection, thumbnails, and swipe dismissal (#9356)

Signed-off-by: dessert <7d616e7e143e5d408159614dccff1371350a1c1bd36c8de838a45ece5aca0aca@buzz.block.builderlab.xyz>

This branch was successfully deployed

1 active deployment
codex-review — 296ee2f1 Deployed Nov 12, 2026 by brow via Run Codex Security Review #14547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants