server: guard nil liveParams when no orchestrators available for AI request#3939
server: guard nil liveParams when no orchestrators available for AI request#3939SAY-5 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR adds a nil-guard in ChangesNon-live AI request nil-pointer panic fix
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
08559dd to
72d2c95
Compare
|
Rebased onto current master to clear the changelog conflict; the nil-guard change itself is unchanged and it is mergeable again. |
Summary
Fixes #3917. A non-live AI request (e.g.
audio-to-text) panics with a nil-pointer dereference instead of returning an error when no orchestrators are available, for example when every eligible orchestrator is rejected by the per-capability max price filter and--ignoreMaxPriceIfNeeded=false.In
processAIRequest, theresp == nil("no orchestrators available") branch builds astream_tracemonitor event that unconditionally dereferencesparams.liveParams.streamID,params.liveParams.pipelineIDandparams.liveParams.requestID.liveParamsis only set for realtime video pipelines and is nil for all other AI requests, so the dereference panics and the gateway closes the connection without an HTTP response (curl: (52) Empty reply from server).Changes
stream_traceevent behindparams.liveParams != nil, mirroring the existing nil guards used elsewhere in the same function. Non-live requests now return the existingServiceUnavailableError("no orchestrators available").processAIRequestwith an empty session pool and nilliveParams, asserting aServiceUnavailableErroris returned rather than a panic.Test plan
go test ./server/ -run Test_processAIRequest_NoOrchestrators_NonLive -raceNote: I could not run the server package test suite locally because building it requires the patched LPMS ffmpeg toolchain (the system ffmpeg here is incompatible with the cgo bindings). The change is gofmt-clean and relies only on existing symbols; please rely on CI to validate the build.
Summary by CodeRabbit