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

ovn-kubernetes / libovsdb / 25870806382
50%
main: 48%

Build:
Build:
LAST BUILD BRANCH: conmgr
DEFAULT BRANCH: main
Ran 14 May 2026 04:08PM UTC
Jobs 1
Files 75
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

14 May 2026 04:05PM UTC coverage: 49.378% (+1.3%) from 48.092%
25870806382

Pull #472

github

dave-tucker
client: introduce ConnectionManager to fix reconnect/disconnect races

Add a ConnectionManager (CM) — a finite-state machine goroutine that
owns all OVSDB connection lifecycle and proxies RPC calls, eliminating
the data races and panics that occurred when concurrent callers triggered
reconnect and disconnect simultaneously.

ConnectionManager (client/connection.go):
- New FSM with three states: Disconnected, Connecting, Connected.
- Single run-loop goroutine that serialises all state transitions;
  commands arrive on a buffered cmdCh and responses on per-command reply
  channels.
- Server-push notifications (update/update2/update3) are forwarded to the
  client event loop via a 64-slot eventCh so the rpc2 callback returns
  immediately and never blocks on cache work.
- Inactivity probing, leader-only mode, and multi-endpoint failover are
  all handled inside the CM run loop, removing the goroutine-per-concern
  races present in the previous implementation.
- Close() keeps the CM alive in drain mode so in-flight commands receive
  ErrNotConnected rather than blocking; Connect() after Close() restarts
  the event loop cleanly.

client.go / event loop:
- runEventLoop() reads from eventCh and dispatches:
    EventDisconnected  — purges cache, sets deferUpdates=true
    EventReconnected   — re-applies schema and reestablishes monitors
    EventInboundRPC    — applies update/update2/update3 to the cache
- waitForCacheConsistent() polls deferUpdates under cacheMutex.RLock so
  Get/List/etc. block until the post-reconnect monitor replay finishes.

Bug fixes:
- Close() deadlock when reestablishMonitors was in-flight.
- Close() hang when cache event handlers blocked on shutdown.
- Connect() after Close() failing to restart the event loop.
- Data race in DatabaseModel/Mapper accessed without modelMutex.

Integration test fixes:
- Reset model struct on each Eventually iteration: model.CloneInto uses
  json.Unmarshal which merges into existing maps rather than rep... (continued)
Pull Request #472: client: introduce ConnectionManager to fix reconnect/disconnect panics

831 of 1014 new or added lines in 5 files covered. (81.95%)

17 existing lines in 1 file now uncovered.

6553 of 13271 relevant lines covered (49.38%)

117.33 hits per line

Uncovered Changes

Lines Coverage ∆ File
123
80.38
client/connection.go
60
76.53
0.04% client/client.go

Coverage Regressions

Lines Coverage ∆ File
17
76.53
0.04% client/client.go
Jobs
ID Job ID Ran Files Coverage
1 25870806382.1 14 May 2026 04:08PM UTC 75
49.38
GitHub Action Run
Source Files on build 25870806382
  • Tree
  • List 75
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #472
  • PR Base - main (#25801728188)
  • Delete
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