Skip to content

fix(relay): cells without a seat feed stay out of shadow coverage and switch state - #27058

Merged
Jinwoo-H merged 1 commit into
mainfrom
relay-no-feed-cells
Oct 10, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
relay-no-feed-cells

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​114 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​113
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29

Summary

Two relay cells, c17 and c18, run an image without the seat feed. They are overflow cells, usually empty, and they stay on the database path through step 5. A director that polls them gets a 404 and records them as "no feed". This PR makes two places handle that state cleanly.

  • Shadow compare coverage.
    • Before: a database answer naming a no-feed cell, or a map seat on one, was classed cell-unpolled. That class is what the E-shadow coverage gate counts against ("≥ 99.9% of compares on polled cells are not cell-unpolled"), so hosts on c17/c18 read as a coverage gap the feed could never close.
    • After: these get a new class, cell-no-feed, which is explained and kept out of the coverage measure. Cells that do have a feed but miss polls are still cell-unpolled, as before.
  • Stale switch state.

Directors only. Cells are unchanged, so nothing changes on the wire. The new class is one more label value in the existing compare log line.

Why this approach

Treating no-feed as its own class, rather than dropping those compares, keeps them visible in the counts while letting the gate exclude them by name. Whether a host is on c17/c18 is still answered from the database, as today.

Testing

shadow-directory-compare, shadow-seat-directory and host-whereabouts-app tests pass (40), including a new compare case for both sides and a rollback-to-404 poller test. tsc is clean.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf8bfe86-51d1-48b6-86f7-7f83616cd1c4



📥 Commits

Reviewing files that changed from the base of the PR and between 510b98e and 92822cd.




📒 Files selected for processing (3)
  • cloud/apps/relay/src/assignment-store.ts
  • cloud/apps/relay/src/shadow-directory-compare.ts
  • cloud/apps/relay/src/shadow-seat-directory.ts



Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.





📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The seat-feed query now includes each cell’s runtime incarnation when available. The directory records the incarnation associated with applied flags. After a 404, it retains reserve-mode flags when the runtime incarnation matches or is unspecified, and clears them otherwise. Shadow comparison classifies no-feed cells as cell-no-feed, separately from other non-live cells. Tests cover these changes.





Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to 92822

A cell restart can briefly leave stale reserve state that changes assignment decisions. Resolve or explicitly accept this risk before merging.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the behavior change, motivation, implementation approach, and testing. It does not provide the required linked issue, visual-proof section with an explicit N/A statement, or c… Add an actual issue link after “Fixes #”. Complete the Visual Proof section with “N/A” and a reason because this is not a UI change. Complete or explain the Testing checkboxes and address the Review, Notes, and Checklist sections.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly summarizes the main change: handling relay cells without a seat feed in shadow coverage and switch-state tracking.

Full details: Description check

Explanation

The description explains the behavior change, motivation, implementation approach, and testing. It does not provide the required linked issue, visual-proof section with an explicit N/A statement, or completed checklist and review details.


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR






  • 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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 613978ce-d486-4c9e-9d73-993da74044e1
📥 Commits

Reviewing files that changed from the base of the PR and between 4e8267f and 4f4170f.

📒 Files selected for processing (3)
  • cloud/apps/relay/src/assignment-store.ts
  • cloud/apps/relay/src/shadow-seat-directory.test.ts
  • cloud/apps/relay/src/shadow-seat-directory.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment on lines 561 to 567
if (stopped) return false
if (response.status === 404) {
await response.body?.cancel().catch(() => undefined)
directory.markNoFeed(cell.cellId, now())
directory.markNoFeed(cell.cellId, now(), cell.incarnation)
return false
}
if (!response.ok) {

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

set -eu
printf '%s\n' '--- shadow-seat-directory relevant declarations and methods ---'
sed -n '130,235p;470,590p' cloud/apps/relay/src/shadow-seat-directory.ts
printf '%s\n' '--- poller owner and refresh flow ---'
sed -n '130,185p' cloud/apps/relay/src/relay-server.ts
sed -n '480,590p' cloud/apps/relay/src/shadow-seat-directory.ts
printf '%s\n' '--- refresh/listCells references ---'
rg -n -F --glob '*.ts' -- 'listCells' cloud/apps/relay/src || test "$?" -eq 1
rg -n -F --glob '*.ts' -- 'setCells' cloud/apps/relay/src || test "$?" -eq 1
printf '%s\n' '--- cell-state response ---'
sed -n '1575,1615p' cloud/apps/relay/src/app.ts

Repository: stablyai/orca

Length of output: 19509


Use the current incarnation when handling a 404.

The 404 branch passes the cached cell.incarnation to markNoFeed. If the process changed from A to B after the cell-list refresh, markNoFeed treats A as unchanged and retains A's reserve flags. The cell-state response then exposes those stale flags.

Read the current incarnation before calling markNoFeed. If the lookup fails or has no incarnation, pass undefined so existing retention behavior remains unchanged.

Suggested fix
     if (response.status === 404) {
       await response.body?.cancel().catch(() => undefined)
-      directory.markNoFeed(cell.cellId, now(), cell.incarnation)
+      let runtimeIncarnation: string | undefined
+      try {
+        const listed = await options.listCells()
+        runtimeIncarnation = listed.find(({ cellId }) => cellId === cell.cellId)?.incarnation
+      } catch {
+        // An unknown incarnation preserves the existing reserve state.
+      }
+      directory.markNoFeed(cell.cellId, now(), runtimeIncarnation)
       return false
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (stopped) return false
if (response.status === 404) {
await response.body?.cancel().catch(() => undefined)
directory.markNoFeed(cell.cellId, now())
directory.markNoFeed(cell.cellId, now(), cell.incarnation)
return false
}
if (!response.ok) {
if (stopped) return false
if (response.status === 404) {
await response.body?.cancel().catch(() => undefined)
let runtimeIncarnation: string | undefined
try {
const listed = await options.listCells()
runtimeIncarnation = listed.find(({ cellId }) => cellId === cell.cellId)?.incarnation
} catch {
// An unknown incarnation preserves the existing reserve state.
}
directory.markNoFeed(cell.cellId, now(), runtimeIncarnation)
return false
}
if (!response.ok) {

@Jinwoo-H
Jinwoo-H changed the base branch from main to relay-step5-director October 10, 2026 02:47
@Jinwoo-H
Jinwoo-H force-pushed the relay-step5-director branch from b6ee5a7 to 71aa37b Compare October 10, 2026 06:18
… switch state

Rebased onto main as one commit after its parent squash-merged.
@Jinwoo-H
Jinwoo-H force-pushed the relay-no-feed-cells branch from 79b08ef to 92822cd Compare October 10, 2026 06:26
@Jinwoo-H
Jinwoo-H changed the base branch from relay-step5-director to main October 10, 2026 06:26
@Jinwoo-H
Jinwoo-H merged commit 3f7943c into main Oct 10, 2026
28 of 46 checks passed
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.

1 participant