Skip to content

Commit 22614c8

Browse files
authored
Merge pull request #1095 from LibreQoE/fix_207
Make lqosd Watchdog Diagnostic-Only and Harden Reload/Attach Failures
2 parents 6699621 + 935e22a commit 22614c8

16 files changed

Lines changed: 1691 additions & 537 deletions

File tree

docs-es/v2.0/troubleshooting-es.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ sudo systemctl status lqosd
107107
journalctl -u lqosd --since "10 minutes ago"
108108
```
109109

110+
Si el log muestra `LibreQoS failed to attach the XDP/TC kernel` o `Unable to load the XDP/TC kernel`, trate el arranque de `lqosd` como fallido. La WebUI y el bus local no arrancan hasta que el programa del kernel se cargue y se adjunte correctamente. El error de carga incluye el valor de retorno bruto, el número errno y el código errno, por ejemplo `raw=-11, errno=11, code=EAGAIN`. Revise si hay un programa XDP existente, un hook TC ocupado, falta de soporte del driver o mapas BPF fijados obsoletos antes de reiniciar `lqosd`.
111+
110112
### Depuración avanzada de lqosd
111113

112114
```bash
@@ -133,21 +135,22 @@ Las instalaciones antiguas anteriores al entorno virtual pueden mostrar `ModuleN
133135

134136
Si el scheduler falla inmediatamente después de un reinicio con un mensaje como `Socket (typically /run/lqos/bus) not found`, eso indica que `lqosd` todavía no había terminado de enlazar el bus local. Los builds actuales esperan brevemente la disponibilidad del bus al arrancar el scheduler en lugar de abortar de inmediato, por lo que ya no deberían aparecer panics repetidos de arranque tras un reinicio.
135137

136-
Si `journalctl -u lqosd` muestra `lqosd memory watchdog restarting daemon`, el daemon salió intencionalmente antes de que la presión de memoria del host llegara al camino OOM del kernel. Systemd debería reiniciar `lqosd` automáticamente. Capture esa línea de log antes de cambiar ajustes; incluye memoria disponible, RSS/swap de `lqosd`, cantidad de hilos, cantidad de flujos y contadores de tiempo que ayudan a diagnosticar el origen del crecimiento de memoria.
138+
Si `journalctl -u lqosd` muestra `lqosd host memory pressure` o `lqosd process memory critical`, el daemon detectó uso alto de memoria y registró contexto de diagnóstico. El watchdog no reinicia `lqosd`; registra memoria disponible, memoria total, RSS/swap de `lqosd`, cantidad de hilos, cantidad de flujos y contadores de tiempo que ayudan a diagnosticar el origen del crecimiento de memoria. La presión de memoria del host se registra cuando la memoria disponible está por debajo del 10% de la RAM instalada. La memoria del proceso se registra como crítica cuando el RSS más swap de `lqosd` alcanza el 90% de la RAM instalada.
137139

138-
El watchdog se puede ajustar con overrides de entorno de systemd:
140+
Puede desactivar estos diagnósticos con un override de entorno de systemd durante ventanas cortas de diagnóstico:
139141

140142
```bash
141143
sudo systemctl edit lqosd
142144
```
143145

144-
Las variables comunes son `LQOSD_MEMORY_WATCHDOG_MIN_AVAILABLE_MB`, `LQOSD_MEMORY_WATCHDOG_MAX_PROCESS_MB` y `LQOSD_MEMORY_WATCHDOG_MAX_SWAP_MB`. Use `LQOSD_MEMORY_WATCHDOG_DISABLED=1` solo durante ventanas cortas de diagnóstico en las que esté observando activamente la presión de memoria.
146+
Use `LQOSD_MEMORY_WATCHDOG_DISABLED=1` solamente cuando esté observando activamente la presión de memoria con otra herramienta.
145147

146148
### El estado del scheduler en WebUI aparece no saludable
147149

148150
Versiones recientes muestran estado/readiness del scheduler en WebUI.
149151
Si el modal del scheduler indica que se agotó el tiempo al cargar detalles, las versiones actuales mantienen visible la última instantánea buena del scheduler con su antigüedad en lugar de convertir ese problema de transporte en un error del scheduler. Trate primero esa advertencia como un problema de comunicación entre WebUI y `lqosd`, y confirme la salud real del scheduler en los logs antes de asumir que falló el shaping.
150152
Si falla un subproceso de integración pero el shaping puede continuar con la última topología válida, el scheduler puede seguir mostrando estado ready, pero el último error de integración permanece visible en el estado del scheduler hasta la siguiente integración exitosa.
153+
Si el scheduler no puede leer `lqos_overrides.json` o sus capas materializadas porque otro proceso mantiene el lock de overrides, las versiones actuales reintentan brevemente y luego bloquean esa recarga. La topología anterior permanece en uso, y el error del scheduler incluye detalles del proceso que mantiene el lock, como PID, nombre de proceso, operación y hora de creación cuando estén disponibles.
151154

152155
Si aparece caído/desactualizado:
153156

docs/v2.0/troubleshooting.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ Press the End key on the keyboard to take you to the bottom of the log to see th
129129

130130
Lqosd will provide specific reasons it failed, such as an interface not being up, an interface lacking multi-queue, or other concerns.
131131

132-
If `journalctl -u lqosd` shows `lqosd memory watchdog restarting daemon`, the daemon intentionally exited before host memory pressure reached the kernel OOM path. Systemd should restart `lqosd` automatically. Capture the watchdog log line before changing settings; it includes available memory, `lqosd` RSS/swap, thread count, flow count, and timing counters that help diagnose the source of memory growth.
132+
If the log shows `LibreQoS failed to attach the XDP/TC kernel` or `Unable to load the XDP/TC kernel`, treat `lqosd` startup as failed. The WebUI and local bus will not start until the kernel program loads and attaches successfully. The load error includes the raw return value, errno number, and errno code, for example `raw=-11, errno=11, code=EAGAIN`. Check for an existing XDP program, busy TC hook, missing driver support, or stale pinned maps before restarting `lqosd`.
133133

134-
The watchdog can be tuned with systemd environment overrides:
134+
If `journalctl -u lqosd` shows `lqosd host memory pressure` or `lqosd process memory critical`, the daemon detected high memory usage and logged diagnostic context. The watchdog does not restart `lqosd`; it records available memory, total memory, `lqosd` RSS/swap, thread count, flow count, and timing counters that help diagnose the source of memory growth. Host memory pressure is logged when available memory is below 10% of installed RAM. Process memory is logged as critical when `lqosd` RSS plus swap reaches 90% of installed RAM.
135+
136+
You can disable these diagnostics with a systemd environment override during short troubleshooting windows:
135137

136138
```bash
137139
sudo systemctl edit lqosd
138140
```
139141

140-
Common override variables are `LQOSD_MEMORY_WATCHDOG_MIN_AVAILABLE_MB`, `LQOSD_MEMORY_WATCHDOG_MAX_PROCESS_MB`, and `LQOSD_MEMORY_WATCHDOG_MAX_SWAP_MB`. Use `LQOSD_MEMORY_WATCHDOG_DISABLED=1` only for short troubleshooting windows where you are actively watching memory pressure.
142+
Set `LQOSD_MEMORY_WATCHDOG_DISABLED=1` only when you are actively watching memory pressure through another tool.
141143

142144
### Advanced lqosd debug
143145

@@ -200,6 +202,8 @@ If specific APs or switches appear multiple times with suffixed names such as `.
200202

201203
If an integration subprocess fails, current builds keep the scheduler alive, publish a shortened output preview to the scheduler status/error surfaces, and save the full captured output to a timestamped file under `/tmp` such as `lqos_scheduler_uisp_integration_YYYYMMDD_HHMMSS.log`. If shaping can continue from the last-known-good topology, the scheduler may still report ready, but the latest integration failure remains visible in scheduler status until the next successful integration run.
202204

205+
If the scheduler cannot read `lqos_overrides.json` or its materialized override layers because another process holds the overrides lock, current builds retry briefly and then block that reload. The previous topology remains in use, and the scheduler error includes lock-holder details such as PID, process name, operation, and lock creation time when available.
206+
203207
### Scheduler status in WebUI looks unhealthy
204208

205209
Recent builds expose scheduler readiness/state in the WebUI (Node Manager).

0 commit comments

Comments
 (0)