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

オープン 初心者向け
#456 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, kubernetes

調査の方向性

internal/ax/reconciler.go の checkReady から始め、router と worker を直接どのようにチェックしているかを調べてください。issue では、router がすぐに応答するにもかかわらず、直接のリクエストが 2 s のタイムアウトまで待つと報告されています。提案されている 2 つのテストケースを確認してください。router は ready だが worker が応答しないケースと、router は失敗するが worker は ready のケースです。チェックが意図した順序に従い、両方のケースが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Go
スター
14.8k
フォーク
802
平均マージ
18時間 37分
マージ済み PR(30日)
110

環境構築

はじめの一歩

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

google/ax のほかの issue

google/ax の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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