bug: engaging a workspace can fail while a sync controller is stopping, and the workspace is dropped for all controllers
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #215 @Wompipomp による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go, kubernetes
調査の方向性
Start with the DynamicMultiClusterManager and clusterTracker.Engage() code paths that forward engagements to sync controllers, and check how a controller is removed while its Start() has not yet returned. The test TestEngageWhileControllerIsStopping, described in the issue, is the reproduction to run; a fix is done when it passes and an engagement during controller shutdown no longer fails for healthy controllers.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When a sync controller is stopped, its context is cancelled, but it stays registered in the
DynamicMultiClusterManager until its Start() has returned (for example while a worker finishes
its current reconcile). If a workspace is engaged during that window, clusterTracker.Engage()
forwards the engagement to the stopping controller as well. Its per-cluster watch cannot sync with
the cancelled context, so Engage() can fail with
failed to watch for cluster "<workspace>": context canceled
clusterTracker.Engage() returns that error to multicluster-runtime, which removes the cluster
again (clusters.Clusters.Add calls Remove when Engage fails). The workspace is then not
served by any sync controller, including the healthy ones, until the next APIBinding event for that
workspace makes the provider engage it again, or the agent restarts.
On current main this is latent, since running sync controllers are not stopped deliberately. The
fix for #182 (#211) stops the running controller on every PublishedResource update, which makes
this reachable.
Steps To Reproduce
- Run the agent with a PublishedResource whose sync controller takes a moment to finish a
reconcile. - Stop that sync controller (e.g. delete or update the PublishedResource with #211 applied)
and, while it is shutting down, bind the APIExport in a new workspace. - The engagement of the new workspace fails with the error above (timing-dependent, not on every
attempt) and objects in it are not synced, also not for other PublishedResources.
The unit test in the PR (TestEngageWhileControllerIsStopping) reproduces this without a cluster:
it keeps a stopped controller inside a reconcile and engages a new cluster in the meantime. It
fails without the fix with the error above; adapted to main's types it fails there in the same
way.
Expected Behaviour
A controller that is shutting down does not affect the engagement of a workspace for the other
controllers.
Additional Context
No response
- 主要言語
- Go
- スター
- 25
- フォーク
- 35
- 平均マージ
- 3日 19時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
kcp-dev/api-syncagent のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kcp-dev/api-syncagent#161 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
kcp-dev/api-syncagent#200 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Support namespace caches for authorized local Secrets対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
kcp-dev/api-syncagent#195 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
kcp-dev/api-syncagent#188 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
kind/feature
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
kcp-dev/api-syncagent#186 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
kcp-dev/api-syncagent の issue をすべて見る
似ている issue
-
ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jordansmall/spindrift#7895 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
documentation priority: medium skill: intermediate status: ready for dev
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hyperledger-labs/fabric-smart-client#2830 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信