• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gatewayd-io / gatewayd / 12449272098
60%

Build:
DEFAULT BRANCH: main
Ran 21 Dec 2024 11:27PM UTC
Jobs 1
Files 63
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Dec 2024 11:24PM UTC coverage: 62.449% (+0.5%) from 61.911%
12449272098

push

github

web-flow
Add Raft State Management for Load Balancers (#641)

* feat(raft): add round-robin state management

- Implemented round-robin state to enhance leader election and task distribution.
- Updated Raft state machine to incorporate round-robin logic.
- Added tests to ensure correct round-robin behavior in various scenarios.

This change improves the efficiency and fairness of task handling within the Raft cluster.

* Fix race condition in server test by adding mutex for proxy state checks

- Introduced a mutex (`proxyStateMutex`) to synchronize access to proxy state checks in `testProxy` function.
- Modified the `testProxy` function to lock the mutex before checking the state of `AvailableConnections` and `busyConnections`.
- Updated the test logic to ensure that one of the proxies is in the expected state, preventing race conditions where the second goroutine could access the connection state prematurely.
- Removed the `proxy` parameter from `testProxy` function calls as it is no longer needed.

This change addresses a race condition that could cause the second goroutine to access connection states before they are properly synchronized, ensuring reliable test results.

* feat: Add weighted round-robin state to Raft

Add support for storing weighted round-robin load balancer state in Raft FSM
to ensure consistency across cluster nodes. Changes include:

- Add WeightedProxy and WeightedRRPayload structs for state management
- Store proxy weights in Raft FSM using weightedRRStates map
- Update WeightedRoundRobin to use Raft for weight tracking
- Add new CommandUpdateWeightedRR command type
- Remove local weight tracking in favor of distributed state

This change ensures that proxy weights remain consistent across cluster nodes
during failover and leader changes.

* perf(network): optimize weighted round-robin with batch updates

Improve performance of WeightedRoundRobin.NextProxy by reducing Raft operations:
- Replace multiple individual Raft updates with a ... (continued)

176 of 212 new or added lines in 4 files covered. (83.02%)

2 existing lines in 1 file now uncovered.

5044 of 8077 relevant lines covered (62.45%)

17.44 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
77.14
10.48% network/roundrobin.go
4
90.24
-3.09% network/weightedroundrobin.go
28
64.94
8.26% raft/raft.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
90.24
-3.09% network/weightedroundrobin.go
Jobs
ID Job ID Ran Files Coverage
1 12449272098.1 21 Dec 2024 11:27PM UTC 63
62.45
GitHub Action Run
Source Files on build 12449272098
  • Tree
  • List 63
  • Changed 13
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 86ec724e on github
  • Prev Build on main (#12421560672)
  • Next Build on main (#12458569615)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc