Workspace readiness waits 2 s for a direct check before it asks the router

Abierto Apto para principiantes
#456 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, kubernetes

Línea de trabajo

Empieza con checkReady en internal/ax/reconciler.go e inspecciona cómo comprueba directamente el router y el worker; el issue informa de que la solicitud directa espera a que se cumpla un timeout de 2 s aunque el router responde rápidamente. Revisa los dos casos de prueba propuestos: un router listo con un worker que no responde y un router que falla con un worker listo. El trabajo estará terminado cuando las comprobaciones sigan el orden previsto y ambos casos pasen.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

After ResumeActor, the controller polls /readyz?check=workspace in checkReady (internal/controller/reconciler.go). It tries http://<workerIP>:80 first and only then the atenet router. The direct check cannot succeed. Substrate gives each worker pool a NetworkPolicy that accepts connections only from the atenet router (cmd/atecontroller/internal/controllers/networkpolicy_controller.go in Substrate), so the controller's packets are dropped. On my kind lab with Substrate main c4129c9 the request therefore waits for the full 2 s httpClient timeout, and the router check that follows answers 200 in about 15 ms. So the first resume of every task spends 2 s on a request that cannot succeed.

I checked both paths from a pod in the cluster with the same headers the controller uses. From the ax-system namespace every port of the worker pod times out, and the policy that does it is substrate-ax-workers-*.

direct  http://<workerIP>:80/readyz?check=workspace           -> no answer after 5 s
router  http://atenet-router.ate-system.svc.cluster.local:80   -> 200 in 0.015 s
        (ate-target-actor: default/<actor>)

I swapped the order in a fork, so the router goes first when ATENET_ROUTER_ADDR is set. Only a router 200 ends the check. Any other result still goes on to the direct check, as now. It touches checkReady only, plus a test with two cases, a ready router with a worker that never answers, and a failing router with a ready worker. The first case fails with the current order. Over 5 small tasks each, resume went from 2.19 s to 0.17 s and the whole task from 3.85 s to 2.06 s (medians). Suspend and resume of 512 MiB and 2 GiB workspaces and a chaos run with 8 tasks still pass.

The change is at https://github.com/eren23/ax/compare/a3ad2af...1db4c33

This is separate from #387, which is about old Substrate releases that reject the router Host. Here the router answers fine and the time goes to the direct check before it.

Lenguaje dominante
Go
Estrellas
14.8k
Forks
802
Merge medio
18 h 37 min
PR fusionados (30 d)
110

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de google/ax

Todos los issues de google/ax

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.