Skip to content

server: nil-check OrchestratorInfo on BroadcastSession getters#3919

Closed
SAY-5 wants to merge 3 commits into
livepeer:masterfrom
SAY-5:fix/broadcast-session-orchinfo-nil-3917
Closed

server: nil-check OrchestratorInfo on BroadcastSession getters#3919
SAY-5 wants to merge 3 commits into
livepeer:masterfrom
SAY-5:fix/broadcast-session-orchinfo-nil-3917

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 2, 2026

Copy link
Copy Markdown

Transcoder() and Address() panicked when a session whose OrchestratorInfo had been wiped by selection filters was reused. Return empty strings rather than crashing the caller goroutine. Fixes #3917.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed potential runtime errors in broadcast session management to improve application stability and reliability.

Review Change Stack

Transcoder() and Address() crashed when a session reused a session whose
OrchestratorInfo had been wiped by selection filters; return empty
strings rather than panicking the caller goroutine.

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@github-actions github-actions Bot added the go Pull requests that update Go code label May 2, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62f1acb1-a744-43f3-98e0-611149af1d80

📥 Commits

Reviewing files that changed from the base of the PR and between 7b966ba and bb54166.

📒 Files selected for processing (1)
  • server/rpc.go

📝 Walkthrough

Walkthrough

This PR adds defensive nil-checks to two RPC session methods that access orchestrator information. Both BroadcastSession.Transcoder() and BroadcastSession.Address() now guard against nil OrchestratorInfo by returning an empty string before dereferencing, preventing potential nil pointer panics.

Changes

Orchestrator Info Nil-Safety Guards

Layer / File(s) Summary
Orchestrator info nil-safety guards
server/rpc.go
BroadcastSession.Transcoder() and BroadcastSession.Address() add nil-checks for bs.OrchestratorInfo before accessing its fields, returning empty strings when nil to prevent dereference panics.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐰 A nil check here, a guard down there,
Protects the code from panicked despair!
OrchestratorInfo now plays it safe—
No dereferencing without a face! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR implements defensive nil-guards (option 2) but does not address the semantic fix (option 1) recommended as the correct solution in issue #3917. Ensure fallback orchestrator selection respects the same price/capability/blocklist filters as primary selection to prevent reintroduction of rejected orchestrators [#3917].
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding nil-checks to OrchestratorInfo in BroadcastSession getter methods.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to server/rpc.go and directly address the defensive nil-guard backstop for issue #3917.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@SAY-5

SAY-5 commented Jun 9, 2026

Copy link
Copy Markdown
Author

Closing in favor of #3939, which handles the panic at the reported call site and includes a test.

@SAY-5 SAY-5 closed this Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

Gateway nil-pointer panic when AI request has all orchestrators price-filtered

1 participant