Repository navigation
fix(commons): handle missing MAC addresses - #3335
Conversation
- Skip interfaces without hardware addresses in MAC lists. - Publish the MAC cache only after a complete lookup. - Preserve direct lookup failures and cover real interface boundaries.
- Inject a controlled first enumeration failure. - Recover with fixed input instead of live re-enumeration. - Verify the retried result stays cached.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3335 +/- ##
============================================
+ Coverage 52.80% 55.00% +2.20%
+ Complexity 6059 436 -5623
============================================
Files 762 511 -251
Lines 67674 48665 -19009
Branches 9189 6984 -2205
============================================
- Hits 35736 26770 -8966
+ Misses 28394 19214 -9180
+ Partials 3544 2681 -863 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- keep required MAC validation outside lookup wrapping - retain optional null MAC and retry cache behavior - verify the existing loopback diagnostic regression
|
Addressed the outside-diff diagnostic comment. The required missing-hardware-address check now preserves its specific exception message through the existing PD message-only reporting path. Optional MAC aggregation still skips missing addresses and retains the original cache and retry behavior. The existing loopback regression verifies the diagnosis, and the final Commons suite passes on the tested platform. The native interface tests retain their explicit platform assumptions; adding a production injection hook would expand this focused fix. All three independent reviewers checked the published two-file delta. New-head CI remains open. |
Purpose of the PR
VPN and tunnel interfaces can have an IP address without a hardware address. Previously MAC discovery threw a
NullPointerExceptionand left an empty cache, hiding usable interfaces on the next call.Main Changes
Normal MAC encoding, IP enumeration, public signatures and PD IP/MAC identity selection remain unchanged.
Verifying these changes
Added real-JDK loopback and mixed-interface/deduplication controls, plus a deterministic retry regression. Commons and RPC consumer suites, full reactor compilation, formatting and a redacted real-interface before/after control pass.
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO: required documentation is pending; complete it before merging.Doc - Done: documentation is included here or linked below.Doc - No Need: this is an internal helper correction with no new configuration or website behavior.PD REST identity-pairing acceptance remains a separate follow-up.
Summary by CodeRabbit
Paired org PR: hugegraph#307
Conceptual overview
MAC 批量收集跳过缺失硬件地址,仅完整成功后发布缓存,单地址查询仍明确失败。
Conceptual illustration; not test or release-acceptance evidence.