Skip to content

[backport/1.4] Fix Ping discovery KeyError on disappearing interfaces - #4058

Merged
joaoantoniocardoso merged 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/ping-interface-snapshot-race
Jul 30, 2026
Merged

[backport/1.4] Fix Ping discovery KeyError on disappearing interfaces#4058
joaoantoniocardoso merged 1 commit into
bluerobotics:1.4-devfrom
joaoantoniocardoso:backports/1.4/ping-interface-snapshot-race

Conversation

@joaoantoniocardoso

Copy link
Copy Markdown
Member

This is a backport of #4036 into 1.4.


Supersedes #4041 (recreated from fork joaoantoniocardoso/BlueOS-docker instead of same-repo head).

@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: LGTM :shipit:

Backports #4036 into 1.4-dev: replaces network_interface_addresses[interface] with .get(interface, []) in core/services/ping/ping360_ethernet_prober.py:27 to avoid a KeyError when an interface is present in psutil.net_if_stats() but disappears before psutil.net_if_addrs() is called. Adds psutil == 5.7.2 (matching the version pinned across other 1.4-dev services) to core/services/ping/setup.py and to the workspace pyproject.toml, and ships a regression test (test_ping360_ethernet_prober.py) that patches psutil.net_if_stats / net_if_addrs to cover the missing-interface and empty-snapshot cases. The extra sys.path / sys.modules juggling in the test is necessary because 1.4-dev's root pytest collects other services' top-level modules (e.g. ardupilot_manager/exceptions.py) and is called out with a comment.

No further comments, nice job 👍

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@joaoantoniocardoso
joaoantoniocardoso force-pushed the backports/1.4/ping-interface-snapshot-race branch from 592dbf9 to 39327d2 Compare July 29, 2026 13:01
@joaoantoniocardoso
joaoantoniocardoso force-pushed the backports/1.4/ping-interface-snapshot-race branch from 39327d2 to 38fd663 Compare July 29, 2026 13:33
@joaoantoniocardoso
joaoantoniocardoso merged commit d4bacc5 into bluerobotics:1.4-dev Jul 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants