travisghansen / hass-opnsense

OPNsense integration with Home Assistant
194 stars 25 forks source link

Timeout on getting ARP table #115

Closed alceasan closed 1 day ago

alceasan commented 7 months ago

I'm having timeout errors recently, when trying to get ARP table from OPNSense with device tracking.

I manually solved it increasing the timeout global variable from 10 to 25 seconds, but I think it'd be a good idea to have this as a parameter in the integration UI.

Ergerbolt commented 7 months ago

How you change the timeout? I have the same problem.

alceasan commented 7 months ago

It's in custom_components/opnsense/pyopnsense/__init__.py

# value to set as the socket timeout
DEFAULT_TIMEOUT = 10
alexdelprete commented 1 day ago

more than 10s to get the ARP table? there must be some other issue.

please test v0.2.0 and in case create another issue.

travisghansen commented 22 hours ago

The problem with the arp table taking so long is because it resolves names (or can). When name resolution is happening sometimes the DNS implementation will either throttle or do other stupid things that make it take a while.

alexdelprete commented 12 hours ago

But even with dns lookups, if dns is configured properly, shouldn't take all that time. but it can happen with a bad setup.