feat: support for multiple Lavalink instances, with ping affinity support and load balancing#1795
feat: support for multiple Lavalink instances, with ping affinity support and load balancing#1795zapteryx wants to merge 6 commits into
Conversation
…port and load balancing
|
Warning Review limit reached
More reviews will be available in 23 minutes and 45 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ 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 |
There was a problem hiding this comment.
Code Review
This pull request introduces multi-node Lavalink support to Quaver, enabling intelligent load balancing, automatic failover, and region-based routing. It adds QuaverCluster to manage multiple nodes, ClusterPlayerManager to route player operations, and RegionAffinity to persist ping-based region latency data. Feedback on these changes highlights several critical issues: region-based routing is bypassed during player creation because the bot is not yet in the voice channel; selectNodeByAffinity lacks region filtering; region affinity data is keyed only by nodeId, causing different regions to overwrite each other; concurrent asynchronous pruning and cache refreshing can lead to race conditions; and guildNodeMap can retain stale mappings if players are destroyed directly on a node. Additionally, minor improvements were suggested to remove unused methods in RegionAffinity and optimize a loop in ClusterPlayerManager.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces multi-node Lavalink support to Quaver, enabling connections to multiple nodes for load balancing, automatic failover, and region-based routing. It adds QuaverCluster, ClusterPlayerManager, a penalty-based load balancing system, and persistent ping-based region affinity tracking. The review feedback highlights several critical improvements to enhance robustness and cross-platform compatibility. These include fixing a potential startup crash in the penalty calculation when node stats are missing, correcting the region affinity selection to filter by target region instead of averaging all pings, preventing a cache race condition in QuaverCluster, ensuring Windows compatibility for SQLite URIs, and adding defensive checks to avoid runtime errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Thank you for your interest in contributing!
Before proceeding, please review the guidelines for contributing.
nextbranch? (left side)Scope of change
Type of change
Priority
Description
Please describe the changes.
Closes #1772