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

enbility / ship-go / 46401173626
92%

Build:
DEFAULT BRANCH: dev
Ran 30 Nov 2026 10:37AM UTC
Jobs 1
Files 46
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

30 Nov 2026 10:33AM UTC coverage: 92.42% (+0.05%) from 92.375%
46401173626

push

github

web-flow
fix(mdns): release the previous SHIP instance on interface re-announcement (#109)

`reannounceWithNewInterfaces` clears `isAnnounced` up front and then
calls `AnnounceMdnsEntry`, which assigns a fresh `instanceID` without
ever releasing the previous one. Every interface change therefore leaks
one provider-side object — for the avahi provider, an `EntryGroup`.

The failure mode is not gradual. Once the leaked objects reach
avahi-daemon's `objects-per-client-max` (1024 by default), the daemon
rejects every further allocation on that D-Bus connection with `Too many
objects`. `Server.ResolveService` needs an allocation too, so from that
point on **no discovered service can be resolved any more** —
`processService` returns the error, nothing retries, and the entry is
lost until the client reconnects.

I hit exactly this shape in a downstream stack running v0.6.0 (where the
leak came from the missing already-announced guard in
`AnnounceMdnsEntry`, since fixed on dev). In a 10.5 h log, the 1025th
announcement was the first `Too many objects`, and the next remote
restart after that permanently lost the peer from the discovery list
even though the SHIP connection stayed up. The
`reannounceWithNewInterfaces` path is the same bug with a slower
trigger: it is gated on real interface appear/disappear rather than on a
timer, so it needs a flapping interface, but it converges on the same
dead end.

### Change

Capture the live instance, announce the new one, then release the old —
the create-then-swap that `SetAutoAccept` and the pairing loop in this
same function already do.

Two details fall out of the reordering:

- Clearing `isAnnounced` is deferred until just before the
re-announcement. Previously it was cleared first, which made the
no-interfaces path's `UnannounceMdnsEntry()` return early at its own
`isServiceAnnounced()` guard — so when every interface disappeared the
SHIP service was never torn down at all.
`Test_reannounceWithNewInterfaces_NoInterfaces_Wit... (continued)

8 of 8 new or added lines in 1 file covered. (100.0%)

4 existing lines in 2 files now uncovered.

5170 of 5594 relevant lines covered (92.42%)

15072.46 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
80.25
0.0% cert/cert.go
2
95.18
-0.57% mdns/avahi.go
Jobs
ID Job ID Ran Files Coverage
1 46401173626.1 30 Nov 2026 10:37AM UTC 46
92.42
GitHub Action Run
Source Files on build 46401173626
  • Tree
  • List 46
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #46401173626
  • d125c36c on github
  • Prev Build on dev (#46319208498)
  • Next Build on dev (#46401285140)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc