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

enbility / ship-go / 23892701812
95%

Build:
DEFAULT BRANCH: dev
Ran 02 Apr 2026 09:03AM UTC
Jobs 1
Files 34
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

02 Apr 2026 09:00AM UTC coverage: 95.099% (-0.04%) from 95.143%
23892701812

push

github

web-flow
[mDNS] Fix handling of mdns service shutdown and restart (#69)

When using the zeroconf provider, after stopping and restarting the service
(calling Start/Shutdown/Start on the same MdnsManager), mDNS
announcements would become invisible to other devices and browsing would
stop working entirely. This happened because of two bugs:

1. MdnsManager.Shutdown() used sync.Once, which can only fire once.
After the first Shutdown, every subsequent Shutdown was silently
skipped, so the provider created by a second Start() was never cleaned
up. This leaked multicast sockets and goroutines until the OS ran out of
multicast group slots.

2. ZeroconfProvider used unbuffered channels between chanListener and
the zeroconf Browse goroutine. On shutdown, chanListener stopped reading
but Browse's mainloop could be in the middle of sending an entry. With
no reader, that send blocked forever, leaking the goroutine and its UDP
sockets.

Fixes:
- Replace sync.Once with a mutex and nil-check on mdnsProvider. Shutdown
is still idempotent (multiple calls are safe) but now works again after
a restart.
- Add an isStarted guard to ZeroconfProvider.Start() to prevent
duplicate Browse goroutines if Start is called twice.
- Use buffered channels (capacity 2) so the Browse goroutine can always
complete its pending send even after chanListener exits.
- Add a listenerDone channel so Shutdown waits for the old goroutine to
fully exit before returning, preventing races on restart.
- Remove the OS signal handler from MdnsManager. Libraries should not
register signal handlers; the application is responsible for calling
Shutdown on SIGINT/SIGTERM.

45 of 51 new or added lines in 2 files covered. (88.24%)

2 existing lines in 1 file now uncovered.

3299 of 3469 relevant lines covered (95.1%)

7816.0 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
95.96
-1.41% mdns/zeroconf.go
4
95.79
-0.52% mdns/mdns.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
95.79
-0.52% mdns/mdns.go
Jobs
ID Job ID Ran Files Coverage
1 23892701812.1 02 Apr 2026 09:03AM UTC 34
95.1
GitHub Action Run
Source Files on build 23892701812
  • Tree
  • List 34
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23892701812
  • 4f37427f on github
  • Prev Build on dev (#21584233075)
  • Next Build on dev (#23893306287)
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