-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add dynamic interface management to handle network disconnects #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Breaking change release targeting: - Proper interfaces for testability - Dependency injection - Generated mocks - Improved test coverage - Removal of global state
- Add api/ package with PacketConn, ConnectionFactory, InterfaceProvider interfaces - Add mocks/ package with mockery-generated mocks for testing - Split connection.go into conn_factory.go, conn_ipv4.go, conn_ipv6.go, conn_provider.go - Rename connection.go to mdns.go (contains only mDNS constants) - Export Client type and add NewClient() constructor - Add WithClientConnFactory and WithServerConnFactory options for mock injection - Remove deprecated Server.TTL() method - Add comprehensive unit tests (87.6% coverage) - Update README with v3 examples and testing documentation - Bump version to v3.0.0 Breaking changes: - Browse() now requires a 'removed' channel parameter - Module path is github.com/enbility/zeroconf/v3
This change fixes infinite warning logs when network interfaces disconnect during mDNS operations. Previously, the code would continue attempting to send to disconnected interfaces, generating warnings on every attempt. Key changes: - Add InterfaceManager to track active/failed interfaces with adaptive backoff - Add error classification (isInterfaceGone) to detect interface failures - Update Client and Server to use InterfaceManager for dynamic iteration - Fix Windows conn wrappers to return errors instead of logging them - Add integration tests that simulate the original disconnect scenario The fix uses separate IPv4/IPv6 managers to prevent cross-protocol failure cascades. When an interface fails with ENXIO, ENETDOWN, or similar errors, it's immediately removed from the active set. Recovery is attempted with adaptive backoff (1s, 5s, 30s) when interfaces reappear.
|
Hello, The CPU spinning bug and warning spam appear to be resolved, and everything has been running smoothly overall. I have a question regarding the recovered interfaces in |
|
This is an oversight. Please feel free to add it :) |
- Add missing multicast join in server syncInterfaces() to reactivate recovered interfaces and backoff on failures. - Add client/server unit tests covering join multicast groups success and failure paths
|
I added another change to handle a case in the zeroconf client. If the network interface is only limited to either IPv4/IPv6, the client would return an error and does not continue the setup with the available protocol. |
This change fixes infinite warning logs when network interfaces disconnect
during mDNS operations. Previously, the code would continue attempting to
send to disconnected interfaces, generating warnings on every attempt.
Key changes:
The fix uses separate IPv4/IPv6 managers to prevent cross-protocol failure
cascades. When an interface fails with ENXIO, ENETDOWN, or similar errors,
it's immediately removed from the active set. Recovery is attempted with
adaptive backoff (1s, 5s, 30s) when interfaces reappear.
This required the PR #3
It fixes #1