RNS Logo

rns.recipes

◈ 9ce92808be498e9e05590ff27cbfdfe4
NomadNet 1.4.0 released with experimental image support https://pypi.org/project/nomadnet/

macOS autoconnect discovery tries to use BackboneInterface

Started by ozCleric 1747e565d5d11f4c... ·

ozCleric 9699f98b4d0135f7...
#1

Hello Mark,I think I've found a bug with interface discovery/autoconnect on macOS in RNS 1.4.2. I'm running RNS 1.4.2 installed with pipx on a Mac mini. RNS is using Python 3.12.13. I have: autoconnect_discovered_interfaces = 4 I'm getting errors when RNS tries to connect to discovered BackboneInterfaces: An interface error occurred for BackboneInterface[...]: module 'select' has no attribute 'epoll' I checked the Python environment RNS is actually running under and get: epoll available: False kqueue available: True I understand BackboneInterface itself isn't supported on macOS, so that's expected. The odd bit is that autoconnect seems to be trying to create a BackboneClientInterface on macOS anyway. I had a look through Discovery.py and BackboneInterface.py. Discovery.py seems to know about this limitation when generating discovered interface configs. It checks for Darwin and falls back to TCPClientInterface. But the autoconnect path looks like it uses the advertised interface type directly. If the remote advertises BackboneInterface it creates a BackboneClientInterface. That then ends up in BackboneInterface.ensure_epoll(), which calls select.epoll(), and fails on macOS. So I think the issue is specifically with autoconnect of discovered BackboneInterfaces on Darwin, rather than BackboneInterface not supporting macOS generally. For now I've set: autoconnect_discovered_interfaces = 0 and I'm using TCPClientInterface manually for backbone endpoints. It looks like autoconnect probably needs to check the local platform before creating BackboneClientInterface, or use TCPClientInterface on Darwin in the same way the discovered config generation already does. Happy to post the full logs/config if they're useful. ozCleric

ozCleric 9699f98b4d0135f7...
#2

Oh I really should have checked the formatting for that post, oops sorry…

Anonymous
#3

It does exactly the same thing on Windows last I checked, if you enable interface discovery it spams logs and fails to actually make any interfaces

ozCleric 9699f98b4d0135f7...
#4

Correct. On Windows the autoconnect path bypasses the degradation logic: backbone_support = ( not RNS.vendor.platformutils.is_windows() and not RNS.vendor.platformutils.is_darwin() ) It then directly constructs BackboneClientInterface when the remote advertises itself as a BackboneInterface.

Anonymous
#5

Perhaps nodes could just advertise themselves as TCPInterface so every other node knows it's compatible and can swap out TCPInterface and BackboneInterface

Post a Reply

Supports Markdown: **bold**, *italic*, `code`, ```code blocks```, [links](url)

Log in to upload images

Quote
Copied to clipboard