fix(stats): overview polling overlaps ticks, reorders samples and hides errors; one shared polling controller
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
Línea de trabajo
Read the five polling implementations named in the issue, starting with lib/core/motion/ticker_gated_polling.dart and the PostgreSQL and MySQL stats views. Trace how each view starts and stops polling and handles tick results, then add tests with a fake clock for non-overlapping ticks, error backoff and recovery, and polling paused by TickerMode. Done when all five views use the shared controller and those behaviors are covered.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Five Overview/stats screens poll the server with the same copy-pasted code:
| File | Interval | Tick |
|---|---|---|
features/postgresql/postgres_stats_view.dart:185-200 |
5 s | serverStats() |
features/mysql/mysql_stats_view.dart:143-158 |
5 s | serverStats() |
features/redis/redis_view.dart:196-211 |
3 s | INFO |
features/mongodb/mongo_stats_view.dart:168-191 |
3 s default | serverStatus |
features/extensions/extension_stats_view.dart:104-116 |
5 s | JSON-RPC getServerStats |
Each one does Timer.periodic(interval, (_) => unawaited(_onPollTick())) (also in syncTickerGatedPeriodicTimer, lib/core/motion/ticker_gated_polling.dart:23):
- Ticks overlap. A tick does not wait for the previous one. When the server is slow, requests pile up on it exactly when it is struggling. For extension drivers the RPC timeout defaults to 60 s (
extension_driver_session.dart:189-192), so a hung driver collects up to 12 concurrentgetServerStatscalls. - Samples land out of order. Postgres and MySQL append each result to the sparkline history (
_recordHistory) on completion, so overlapping ticks reorder points. - Errors are invisible.
catch (_) {}in every tick: no "stale since" state, no backoff, the dashboard silently freezes on the last good sample. - The timer is started from
build()viasyncTickerGatedPeriodicTimer(a side effect in build), and each view also keeps its own_startTimer.
Fix
One small PollingController (or mixin) in core/motion / core/util:
- self-rescheduling:
await tick()then schedule the next one, so at most one request is in flight; - gated by
TickerMode(keep the current behaviour) andshouldRun; - exponential backoff on errors, last error + last success time exposed as a
ValueListenablefor a "stale" hint; - started and stopped from
didChangeDependencies/dispose, notbuild.
Replace the five copies. Tests with a fake clock: a slow tick never overlaps; errors back off and recover; TickerMode off stops polling.
- Lenguaje dominante
- Dart
- Estrellas
- 23
- Forks
- 1
- Merge medio
- 31 min
- PR fusionados (30 d)
- 570
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QueryaHub/Querya-Desktop
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Los mantenedores suelen responder en 1 día
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Los mantenedores suelen responder en 1 día
-
bug error-handling settings
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Los mantenedores suelen responder en 1 día
-
enhancement marketplace
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QueryaHub/Querya-Desktop
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
0niel/university-app#617 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
linagora/tmail-flutter#5010 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
chriskelly/wish-together#36 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Web Guide has broken linksAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
[web] Semantics `lang` attribute uses `Locale.toString()`, producing invalid tags like `es_US`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día