Repository navigation
fix(acedatacloud): share OAuth state across MCP replicas - #963
Merged
Merged
Conversation
Germey
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix AceDataCloud hosted MCP reconnect failures after the service moved to two replicas. Dynamic OAuth clients, pending authorization, and one-time authorization codes now use encrypted Redis state shared by both Pods. Unknown client IDs no longer get a fabricated record with the wrong redirect URI.
The deploy script creates a stable Kubernetes Secret on first rollout, starts a dedicated persistent Redis StatefulSet with restricted ingress, and waits for it before updating the MCP Deployment. It fails if the state Secret disappears while the PVC remains, so an accidental key rotation cannot silently invalidate stored clients.
Validation
ruff check .andruff format --check .mypy core tools contractspytest --cov=core --cov=tools --cov=contracts --cov-report=term-missing --cov-fail-under=75: 217 passed, 81.97% coveragepython scripts/sync_contract_docs.py --checkpython -m buildkubectl apply --dry-run=server -f acedatacloud/deploy/production/oauth-redis.yamlRollout
Merge and deploy this PR first. Then deploy the companion AuthBackend PR to rotate previously cached in-memory DCR clients once. Existing active platform tokens remain usable. Previously registered external OAuth clients may need a fresh client registration when they next reconnect; no credential migration from old Pod memory is possible.
If deployment fails, keep the Secret and PVC for recovery. Do not recreate the Secret with a new state key. The existing MCP image can be restored while the new Redis resources remain in place.