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

cybertec-postgresql / vip-manager / 28038794610
48%

Build:
DEFAULT BRANCH: master
Ran 23 Jun 2026 03:57PM UTC
Jobs 1
Files 11
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

23 Jun 2026 03:56PM UTC coverage: 47.987% (+0.3%) from 47.699%
28038794610

push

github

web-flow
[-] remove VIP when DCS becomes unreachable, closes #336 #354 (#383)

* Fix issues #354 and #336: Remove VIP when DCS becomes unreachable

Fixes #354: VIP stays up when etcd is unreachable
Fixes #336: VIP stays up when Patroni is unreachable

## Problem

When DCS (etcd/Patroni/Consul) becomes unreachable:
- VIP was not removed from the interface
- Logs did not clearly show connection failures
- Multi-node setups would experience VIP flapping

## Solution

Enhanced error handling to signal false state on connection failures:

1. **etcd_leader_checker.go**: watch() now sends false immediately on error
2. **patroni_leader_checker.go**: Error logging improved, false sent on connection errors
3. **consul_leader_checker.go**: Error logging improved, false sent on connection errors
4. **Generic logging**: Removed hard-coded 'leader' terminology to support any trigger value

The key principle: send false on any error, let the system decide what to do.
VIP will be removed by IPManager receiving the false state.

## Tests

All existing tests pass plus new tests for disconnection scenarios:
- ✅ TestEtcdLeaderChecker_watch_EmitsOnConnectionLoss
- ✅ TestEtcdLeaderChecker_GetChangeNotificationStream_EmitsOnConnectionError
- ✅ TestPatroniCheckerHandlesDisconnection
- ✅ 30+ existing unit and integration tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Delete FIXES_ISSUES_354_336.md

* Fix PR #383 review comments: deadlock guards and test improvements

- Add context guards to all blocking sends to prevent deadlock during shutdown
  - etcd_leader_checker.go: Guard watch error sends with ctx.Done()
  - etcd_leader_checker.go: Guard normal event sends with ctx.Done()
  - patroni_leader_checker.go: Guard error and success sends with ctx.Done()
  - consul_leader_checker.go: Guard all error path sends with ctx.Done()

- Fix etcd test port allocation to avoid flakiness
  - Replace hard-coded port 59999 with dynamic port allocation
  - Use net.Li... (continued)

27 of 44 new or added lines in 3 files covered. (61.36%)

1 existing line in 1 file now uncovered.

441 of 919 relevant lines covered (47.99%)

0.53 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
80.77
-1.84% checker/etcd_leader_checker.go
4
90.16
-6.06% checker/consul_leader_checker.go
4
90.7
-9.3% checker/patroni_leader_checker.go

Coverage Regressions

Lines Coverage ∆ File
1
80.77
-1.84% checker/etcd_leader_checker.go
Jobs
ID Job ID Ran Files Coverage
1 28038794610.1 23 Jun 2026 03:57PM UTC 11
47.99
GitHub Action Run
Source Files on build 28038794610
  • Tree
  • List 11
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28038794610
  • bb623e73 on github
  • Prev Build on master (#27986988674)
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

© 2026 Coveralls, Inc