Skip to content

[16.0-stable] LPS Network Endpoint Enhancements and Signaling#5953

Merged
eriknordmark merged 6 commits into
lf-edge:16.0-stablefrom
milan-zededa:16.0-lps-signaling
May 13, 2026
Merged

[16.0-stable] LPS Network Endpoint Enhancements and Signaling#5953
eriknordmark merged 6 commits into
lf-edge:16.0-stablefrom
milan-zededa:16.0-lps-signaling

Conversation

@milan-zededa
Copy link
Copy Markdown
Contributor

@milan-zededa milan-zededa commented May 13, 2026

Description

Implements the EVE side of the API additions introduced in
lf-edge/eve-api#144.
Backport of #5904 (see the original PR for more detailed description)
Even though this is strictly speaking a new feature, we have to make an exception here and backport this to 16.0 anyway (for a customer).

How to test and validate this PR

See #5904 for detailed testing instructions.

Changelog notes

  • Low-latency LPS configuration updates. EVE can now receive near-instant
    notifications from the Local Profile Server when new configuration is ready,
    reducing the delay from up to 60 seconds to under 2 seconds. LPS
    applications must implement the optional GET /api/v1/signal streaming
    endpoint to take advantage of this; existing LPS deployments without the
    endpoint continue to work exactly as before.

  • Richer network status in LPS. EVE now reports the live kernel-observed
    state of every network port to LPS on each network POST: link up/down,
    assigned IP addresses (with subnet mask), default gateways, DNS and NTP
    servers, and MTU. LPS applications can display this information to operators
    without needing a separate management channel.

  • Per-port modification permission flag. LPS now knows which network ports
    it is allowed to reconfigure (as provisioned by the controller), so it can
    give operators clear feedback instead of a generic error when they attempt to
    modify a controller-managed port.

  • Reactive LPS network updates. EVE now pushes an updated network POST to
    LPS immediately when the device's network configuration or link state changes,
    rather than waiting for the next periodic tick.

  • Tunable LPS polling intervals. All six LPS polling intervals (local
    profile, radio, app info, device info, network, app boot info) can now be
    adjusted via controller config properties. The defaults are unchanged.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR
  • I've added a reference link to the original PR
  • PR's title follows the template
  • I've checked the boxes above, or I've provided a good reason why I didn't check them.

milan-zededa and others added 6 commits May 13, 2026 11:06
See: lf-edge/eve-api#144

Signed-off-by: Milan Lenco <milan@zededa.com>
Mirror the controller-provisioned SystemAdapter.allow_local_modifications
flag through dpcToProto so LPS can distinguish ports that accept local
configuration from those managed exclusively by the controller, without
having to infer it by trial-and-error via error_message.

Signed-off-by: Milan Lenco <milan@zededa.com>
(cherry picked from commit caca29d)
Open a long-lived GET /api/v1/signal stream to the Local Profile Server
and, upon each incoming Signal message, immediately trigger the listed
endpoints' pollers -- bypassing the ~1-minute periodic cadence while
preserving it as the correctness fallback. This removes the minute-scale
delay that operators previously saw between entering a config change in
the LPS UI and EVE picking it up.

The Signal handler runs as an additional LocalCmdAgent goroutine.
Connection open is guarded by the existing startTask/runInterruptible/
endTask pattern used by the other pollers; the long body read runs
without the task lock so it cannot block pause(). On URL change,
UpdateLpsConfig cancels the in-flight stream and wakes the goroutine,
which reconnects against the current LPS address. Dispatches are
rate-limited (1 signal / 3s, burst 3). LPS 404 throttles reconnect
attempts to once per hour. No watchdog is registered -- a legitimately
long blocking Read must not trigger a device reboot.

A new controllerconn.Client.OpenLocalStream helper provides the
streaming HTTP client (reuses DialerWithResolverCache, adds TCP
keepalive for dead-peer detection, disables HTTP keep-alive for clean
connection teardown, and drops the per-request timeout that SendLocal
applies). The existing triggerProfileGET is exported as
TriggerProfileGET for symmetry with the other Trigger*POST helpers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Milan Lenco <milan@zededa.com>
(cherry picked from commit 2af0c87)
Fire an immediate LPS Network-endpoint POST whenever a substantive change
is detected in either the device port config list (handleDPCLImpl) or the
device network status (handleDNSImpl), so the local operator sees the
effect of a network config change right away instead of waiting for the
next periodic post. A burst of updates during, e.g., DPC verification is
naturally coalesced by the networkTicker's size-1 buffered channel:
TickNow is a non-blocking send, so excess kicks arriving while a POST is
already in flight or pending are dropped.

Signed-off-by: Milan Lenco <milan@zededa.com>
(cherry picked from commit 762ba1a)
Populate the new NetworkInfo.port_status field from DeviceNetworkStatus
when EVE posts to the LPS Network endpoint, giving the local operator
a view of the kernel-observed state of each network port (link up/down,
MAC address, currently-assigned IP addresses, active default routers,
effective DNS servers and search domain, NTP servers in use, and
applied MTU) alongside the existing declarative config views.

CIDR-formatted IP addresses require the interface's subnet mask, which
DeviceNetworkStatus previously did not carry in AddrInfoList. Extend
types.AddrInfo with a Mask field and populate it from the netlink
address entry in DpcManager.updateDNS.

Signed-off-by: Milan Lenco <milan@zededa.com>
(cherry picked from commit bf9c56c)
Add timer.lps.<task>.interval config properties (profile, radio, appinfo,
devinfo, network, appbootinfo) with defaults matching current hard-coded
values, min 3s, max 1h. LocalCmdAgent initializes globalConfig with
DefaultConfigItemValueMap() so all tasks use the correct default before
the first real config arrives. Interval changes take effect immediately
on the next UpdateGlobalConfig call without resetting throttle state.

Signed-off-by: Milan Lenco <milan@zededa.com>
(cherry picked from commit a307da3)
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.55%. Comparing base (9f69150) to head (f142336).
⚠️ Report is 98 commits behind head on 16.0-stable.

Additional details and impacted files
@@               Coverage Diff               @@
##           16.0-stable    #5953      +/-   ##
===============================================
+ Coverage        19.52%   23.55%   +4.02%     
===============================================
  Files               19       19              
  Lines             3021     2509     -512     
===============================================
+ Hits               590      591       +1     
+ Misses            2310     1787     -523     
- Partials           121      131      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknordmark eriknordmark merged commit b6e0408 into lf-edge:16.0-stable May 13, 2026
35 of 36 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