-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix(nvidia): add retry logic for Riva STT sequence timeout errors #4540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When there are pauses in audio, Riva's server-side max_sequence_idle_microseconds timeout expires and releases the sequence. Subsequent audio chunks then fail with an INVALID_ARGUMENT error about missing START flag. This adds a retry loop (max 3 attempts) that catches this specific error and recreates the ASR service connection to get a fresh sequence. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
|
📝 WalkthroughWalkthroughA retry mechanism is added to the recognition worker in the NVIDIA STT plugin, automatically retrying up to 3 times when encountering "start flag" or "sequence" related exceptions, with ASRService recreation on each retry attempt. Changes
Sequence DiagramsequenceDiagram
participant Worker as Recognition Worker
participant AudioGen as Audio Generator
participant ASR as ASR Service
participant Handler as Exception Handler
Worker->>Worker: Initialize retry_count=0
loop Retry Loop (max_retries=3)
Worker->>AudioGen: Create audio generator
Worker->>ASR: Stream audio to ASR
alt Success
ASR-->>Worker: Response received
Worker->>Worker: Reset retry_count=0
Worker->>Handler: Process response
Worker->>Worker: Break loop
else Retryable Exception (start flag/sequence)
ASR-->>Worker: Exception
Worker->>Worker: Increment retry_count++
alt Retry Limit Not Exceeded
Worker->>ASR: Recreate ASRService
Note over Worker: Log warning, continue loop
else Max Retries Exceeded
Worker->>Handler: Log error
Handler->>Worker: Raise exception
Worker->>Worker: Break loop
end
else Non-Retryable Exception
ASR-->>Worker: Exception
Worker->>Handler: Re-raise immediately
Worker->>Worker: Break loop
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
✏️ Tip: You can disable this entire section by setting Comment |
Summary
Background
When there are pauses in audio, Riva's server-side
max_sequence_idle_microsecondstimeout expires and releases the sequence. Subsequent audio chunks then fail with anINVALID_ARGUMENTerror about missing START flag. This fix handles that gracefully by retrying with a fresh connection.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.