mirror of
https://github.com/EttusResearch/uhd.git
synced 2026-10-25 17:36:10 +00:00
usrp_hwd runs all gRPC greenlets on a single gevent hub, so any non-yielding C call blocks every other RPC. Under a uhd_find_devices discovery flood, the GetDeviceInfo interface enumeration run long enough And may starve most claimed RPC past its default 2s client deadline, causing "Deadline Exceeded" failures. Three places that this commit optimizes, all in net.py: - get_local_ip_addrs() used pyroute2 IPDB, which spawns helper threads and mirrors the full link/addr/route/neighbour tables on every call (~100s of ms, non-yielding) --> Replace it with a single stateless IPRoute get_addr() dump. Keep IFA_LOCAL (falling back to IFA_ADDRESS) so the returned set matches IPDB's behaviour, including point-to-point links. - get_link_speed() used to create a new pyudev.Context() per interface, which forks on creation, tripping gRPC's fork handlers. gRPC then freezes all workder threads and restarts after fork is done. Fix is to reuse one PID-guarded pyudev context per process. - get_valid_interfaces() did an O(N) netlink round-trip per interface. This stalls gRPC server. --> Dump all links and IPv4 addresses once and filter in Python. IPRoute stays per-call: it opens its own netlink socket and does not fork, so there is no shared state to lock. |
||
|---|---|---|
| .. | ||
| cmake/Modules | ||
| include | ||
| lib | ||
| python | ||
| systemd | ||
| tests | ||
| tools | ||
| .gitignore | ||
| CMakeLists.txt | ||