net: active_uplink stuck on modem_secondary for ~20 h while modem_primary carries the traffic (v0.12.0-ocw4)

オープン
#431 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@rslater-cs がすでに取り組んでいます。

2026年11月30日 から。

評価

この issue はまだ評価されていません。

説明

Box: BB7GIWO3JLDOFC (bigbox-ss, release group canary-ocw), firmware bigbox-ss-v0.12.0-ocw4-2026-11-18T112303-v22.03.7 (devicecode-lua c835c62). No WAN cable is connected, so modem_primary is the expected uplink.

What the cloud shows (UTC, 25 Nov 2026)

Time net.active_uplink
05:01:41 modem_primary (after the daily reboot)
07:13:36 modem_secondary
07:14:28 modem_primary
07:24:08 modem_secondary
07:24:59 modem_primary
08:46:15 modem_secondary
— nothing more until 26 Nov 05:01:39 (modem_primary, after the reboot)

Hourly rx_bytes over the same window:

  • net.modem_primary: 332 MB at 09:00, 3,900 MB at 10:00, 1,604 MB at 11:00, 633 MB at 12:00, 694 MB at 13:00 and 369 MB at 15:00.
  • net.modem_secondary: about 0–1 MB per hour.

System telemetry was continuous (50–59 messages an hour), so the box was online the whole time. The traffic clearly went through the primary modem, but active_uplink kept saying secondary.

Why it points at the net model

active_uplink is re-sent every 300 s (active_uplink_refresh_loop, src/services/net/service.lua:266), and the metrics pipeline (any_change) only drops repeats. So the net model itself must have held modem_secondary for about 20 hours.

The value comes from the mwan3 policy members that the HAL reports (src/services/net/active_uplink.lua, from_policy). That leaves two possibilities:

  1. the HAL's multiwan/policy snapshot went stale and stopped refreshing; or
  2. mwan3's policy really listed only modem_secondary (primary marked offline by tracking), while established or new flows kept going out through the primary.

Why it matters

The canary checker (jangala-dev/grand-pipeline#26) uses this metric. It warns on a failover to the secondary, and holds a release when a box spends 3 hours on last_resort. For this episode it reported "Traffic moved to modem_secondary 3 time(s), 20.3h after settling", which is false. A value stuck on last_resort would produce a false hold.

Asks

  1. Find which of the two cases it was. Rig repro: force tracking failures on the primary, let it recover, and compare mwan3 status, the HAL snapshot and the metric.
  2. Make sure active_uplink follows the recovery back to modem_primary.

Related: #330 (mwan3 and devicecode disagree on uplink state in the UI, v0.10/v0.11). It may or may not have the same root cause.

主要言語
Lua
スター
1
フォーク
0
平均マージ
1日 8時間
マージ済み PR(30日)
24

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jangala-dev/devicecode-lua のほかの issue

jangala-dev/devicecode-lua の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。