-
Notifications
You must be signed in to change notification settings - Fork 302
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
Cleanup retrySendTimeout func creation #1872
Conversation
WalkthroughThe pull request introduces a refactoring change in the The core logic of the function remains consistent, with the primary change being the extraction and separation of the function definition. The refactored implementation maintains the original behavior of attempting to send a The overall functionality of the ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/wshutil/wshrpc.go (1)
748-752
: Consider adding a maximum retry limit.While the current implementation works, it could potentially run indefinitely if the channel remains full and the server isn't done. Consider adding a maximum retry limit or an exponential backoff strategy.
+ maxRetries := 50 // 5 seconds total (50 * 100ms) + retryCount := 0 for { if done() { return } + retryCount++ + if retryCount >= maxRetries { + log.Printf("Failed to send timeout after %d attempts for resId: %s", maxRetries, resId) + return + } time.Sleep(100 * time.Millisecond) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/wshutil/wshrpc.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Build for TestDriver.ai
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
pkg/wshutil/wshrpc.go (1)
735-747
: LGTM! Clean and thread-safe implementation.The
done
function is well-structured with proper lock handling and clear control flow. The implementation correctly handles both server termination and channel send attempts.
No description provided.