fix(gitea): raise the memory ceiling; time-bound the demo cleanup calls
Gitea wedged at 2073Mi against a 2Gi limit: its API stopped answering even on its own loopback, and the repeated SSH LoginGraceTime drops in its log were starvation symptoms rather than a separate fault. Raised to 3Gi. The reset command's Gitea calls had no --max-time, so a slow service became an indefinite hang with no output - the script appeared frozen after 'clearing bstein/hermes-code-demo'. They now fail after 25 seconds and say so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
4e3be5f7e4
commit
4ffcae8b3c
@ -112,7 +112,7 @@ cmd_reset() {
|
|||||||
for repo in $DEMO_REPOS; do
|
for repo in $DEMO_REPOS; do
|
||||||
note "clearing bstein/$repo (demo repository)"
|
note "clearing bstein/$repo (demo repository)"
|
||||||
local items
|
local items
|
||||||
items="$(curl -s -H "Authorization: token $GITEA_TOKEN" \
|
items="$(curl -s --max-time 25 -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$gitea/api/v1/repos/bstein/$repo/issues?state=all&limit=100" |
|
"$gitea/api/v1/repos/bstein/$repo/issues?state=all&limit=100" |
|
||||||
python3 -c 'import json,sys
|
python3 -c 'import json,sys
|
||||||
for i in json.load(sys.stdin):
|
for i in json.load(sys.stdin):
|
||||||
@ -122,14 +122,14 @@ for i in json.load(sys.stdin):
|
|||||||
else
|
else
|
||||||
while read -r num kind; do
|
while read -r num kind; do
|
||||||
[ -z "$num" ] && continue
|
[ -z "$num" ] && continue
|
||||||
curl -s -o /dev/null -X DELETE -H "Authorization: token $GITEA_TOKEN" \
|
curl -s --max-time 25 -o /dev/null -X DELETE -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$gitea/api/v1/repos/bstein/$repo/issues/$num"
|
"$gitea/api/v1/repos/bstein/$repo/issues/$num"
|
||||||
note " deleted $kind #$num"
|
note " deleted $kind #$num"
|
||||||
done <<< "$items"
|
done <<< "$items"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local branches
|
local branches
|
||||||
branches="$(curl -s -H "Authorization: token $GITEA_TOKEN" \
|
branches="$(curl -s --max-time 25 -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$gitea/api/v1/repos/bstein/$repo/branches" |
|
"$gitea/api/v1/repos/bstein/$repo/branches" |
|
||||||
python3 -c 'import json,sys,urllib.parse
|
python3 -c 'import json,sys,urllib.parse
|
||||||
for b in json.load(sys.stdin):
|
for b in json.load(sys.stdin):
|
||||||
@ -139,7 +139,7 @@ for b in json.load(sys.stdin):
|
|||||||
note " no repair branches"
|
note " no repair branches"
|
||||||
else
|
else
|
||||||
for ref in $branches; do
|
for ref in $branches; do
|
||||||
curl -s -o /dev/null -X DELETE -H "Authorization: token $GITEA_TOKEN" \
|
curl -s --max-time 25 -o /dev/null -X DELETE -H "Authorization: token $GITEA_TOKEN" \
|
||||||
"$gitea/api/v1/repos/bstein/$repo/branches/$ref"
|
"$gitea/api/v1/repos/bstein/$repo/branches/$ref"
|
||||||
note " deleted branch $(printf '%b' "${ref//%/\\x}")"
|
note " deleted branch $(printf '%b' "${ref//%/\\x}")"
|
||||||
done
|
done
|
||||||
@ -191,7 +191,7 @@ cmd_preflight() {
|
|||||||
agents="$(kubectl -n jenkins get pods --no-headers 2>/dev/null | grep -cE '\-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}' || true)"
|
agents="$(kubectl -n jenkins get pods --no-headers 2>/dev/null | grep -cE '\-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{5}' || true)"
|
||||||
note "jenkins agent pods: ${agents:-0}/${cap:-5} (a full pool stalls the demo — wait for a free slot)"
|
note "jenkins agent pods: ${agents:-0}/${cap:-5} (a full pool stalls the demo — wait for a free slot)"
|
||||||
local open_prs
|
local open_prs
|
||||||
open_prs="$(curl -s -H "Authorization: token ${GITEA_TOKEN:-}" \
|
open_prs="$(curl -s --max-time 25 -H "Authorization: token ${GITEA_TOKEN:-}" \
|
||||||
"${GITEA_URL:-https://scm.bstein.dev}/api/v1/repos/bstein/hermes-code-demo/pulls?state=open" 2>/dev/null |
|
"${GITEA_URL:-https://scm.bstein.dev}/api/v1/repos/bstein/hermes-code-demo/pulls?state=open" 2>/dev/null |
|
||||||
python3 -c 'import json,sys; print(len(json.load(sys.stdin)))' 2>/dev/null || echo '?')"
|
python3 -c 'import json,sys; print(len(json.load(sys.stdin)))' 2>/dev/null || echo '?')"
|
||||||
note "open hermes-code-demo PRs: $open_prs (must be 0 — the duplicate guard refuses while one is open)"
|
note "open hermes-code-demo PRs: $open_prs (must be 0 — the duplicate guard refuses while one is open)"
|
||||||
|
|||||||
@ -288,7 +288,11 @@ spec:
|
|||||||
memory: 1Gi
|
memory: 1Gi
|
||||||
limits:
|
limits:
|
||||||
cpu: 1500m
|
cpu: 1500m
|
||||||
memory: 2Gi
|
# Raised from 2Gi: the pod sat at 2073Mi and wedged, refusing
|
||||||
|
# connections on its own loopback while the API timed out from
|
||||||
|
# everywhere. The SSH LoginGraceTime drops in the log are a
|
||||||
|
# symptom of that starvation, not a separate problem.
|
||||||
|
memory: 3Gi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: gitea-data
|
- name: gitea-data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user