Repository navigation
fix(api): time out every apiserver call; retry read-modify-write on conflicts - #82
Merged
Merged
Conversation
…onflicts - Every Kubernetes client call passes a (5s connect, 30s read) _request_timeout. List calls page with limit=500 and follow continue tokens rather than truncating. - Events are fetched by field selector (the App, app-<name>, each current pod and its ReplicaSet) instead of listing the namespace. - PATCH, stop and start re-read and re-apply once when the write conflicts on resourceVersion; a second conflict returns 409, not 500. Closes #47 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pvMUQJoLkBDk6B94TTm45
jbouder
added a commit
that referenced
this pull request
Oct 19, 2026
…, restart 409, safe owner label (#96) - Models carry what the CRD allows: env[].valueFrom, runtime.keepAlive and any resource name (ephemeral-storage, nvidia.com/gpu, claims). - PATCH merges `runtime` and `access` field by field: fields the request leaves out keep their stored value (null/empty removes one), so a UI or MCP edit no longer drops what kubectl or GitOps set. The UI form carries resource names it does not edit, sends null to clear, and shows a valueFrom variable read-only. - POST and PATCH (and so launch_app) return 413 when inline files exceed MAX_UPLOAD_BYTES, the cap uploads already had. - restart returns 409 for a stopped app (replicas 0), as documented. - The owner label is written only when the username is a valid label value; spec.owner stays the owner, so `a@b.c` can create and edit apps. Event matching by exact child names already landed in #82. Closes #57 Claude-Session: https://claude.ai/code/session_016pvMUQJoLkBDk6B94TTm45 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #47
What changes
Timeouts. Every
KubernetesAppStorecall passes_request_timeout=(5, 30)(connect, read), so a slow apiserver can't pin threadpool workers indefinitely. The readiness check keeps its own 3s.Paged lists. List calls go through
_list_custom/_list_typed, which passlimit=500and followcontinuetokens. A barelimitwould silently truncate.pod_logsasks forlimit=1, since it only ever used the first pod.Field-selected events. A field selector can't match a name prefix, so instead of listing every event in the namespace and filtering in Python,
app_eventsqueries by exact name:involvedObject.kind=App,name=<app>app-<app>, which covers the Deployment, Service, ConfigMap and NebariAppEvents of pods or ReplicaSets that no longer exist are no longer returned.
Conflict retry. PATCH, stop and start share
update_app. It re-reads the App, which also re-checks access, re-applies the change (including PATCH's subdomain check) and writes once more. A second conflict returns409 "was changed by someone else; reload and try again"instead of a 500.Upgrade notes
None.
Testing
test_every_call_has_a_timeoutdrives all 13 store methods against mocked clients and asserts_request_timeouton every call.continue.ConflictErrorN times shows PATCH, stop and start succeed after one conflict and return 409 after two.maingave 6 × 200, 10 × 500.🤖 Generated with Claude Code
https://claude.ai/code/session_016pvMUQJoLkBDk6B94TTm45