bug: engaging a workspace can fail while a sync controller is stopping, and the workspace is dropped for all controllers
Mantenedores costumam responder em até 1 dia
Um pull request relacionado já foi integrado.
- #215 de @Wompipomp — integrado
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- go, kubernetes
- Domínio
- backend, distributed-systems
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Go
- Estrelas
- 25
- Forks
- 35
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 16
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de kcp-dev/api-syncagent
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
kcp-dev/api-syncagent#161 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
kind/feature
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
kcp-dev/api-syncagent#200 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Support namespace caches for authorized local SecretsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
kcp-dev/api-syncagent#195 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
kcp-dev/api-syncagent#188 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
kind/feature
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
kcp-dev/api-syncagent#186 · 1 comentário · 2 reações ·
Mantenedores costumam responder em até 1 dia
Todas as issues de kcp-dev/api-syncagent
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
slavakurilyak/awesome-ai-agents#1137 ·
Mantenedores costumam responder em até 1 dia
-
Make the HTTP server's keep-alive and headers timeouts configurableTalvez já em andamento @mattgodbolt assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
compiler-explorer/compiler-explorer#9902 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
jordansmall/spindrift#7895 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia