bug: engaging a workspace can fail while a sync controller is stopping, and the workspace is dropped for all controllers
維護者通常 1 天內回覆
已經有一個關聯 PR 被合併了。
- #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
- 平均合併
- 4 天 12 小時
- 30 天內合併 PR
- 16
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 5/5 一週以上 新手友好度 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 則留言 · 2 個 reaction ·
維護者通常 1 天內回覆
查看 kcp-dev/api-syncagent 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 72/100
slavakurilyak/awesome-ai-agents#1137 ·
維護者通常 1 天內回覆
-
Make the HTTP server's keep-alive and headers timeouts configurable可能已有人在做 @mattgodbolt 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
compiler-explorer/compiler-explorer#9902 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
ready-for-agent
難度 2/5 1-3 小時 新手友好度 76/100
jordansmall/spindrift#7895 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆