Skip to content

Commit 028e885

Browse files
Revert "K2GO-450 fix(forgejo): seed writes a terminal status on abnormal exit"
This reverts commit d946fa2.
1 parent 106ceea commit 028e885

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎static/dashboard/CHANGELOG.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ One line per version, newest first. Every REST-facing change bumps the version i
44
(the app surfaces it via `/system/dashboard/update-check` and the "Update available" pill), so this
55
file is the human record of what each bump enables. Keep entries short: `version - change (TICKET)`.
66

7-
- **1.3.14** - Forgejo seed can no longer stick on "running" (K2GO-450). `tools/forgejo-seed.sh` now installs an `EXIT` trap: any abnormal death (an unbound var under `set -u`, a sourced-file abort, any step that exits the shell) that skips the explicit done/error writes flips a lingering "running" to "error" and leaves a breadcrumb in the log. Before, such a death left the status on "running" forever and the app polled a dead seed for ~20 min with no signal; now the app (which already treats "error" as failure) fails fast. The seed also writes a start timestamp so an empty log is distinguishable from a never-started seed. Not a REST-surface change; the version bump is the delivery mechanism so deployed boxes pick up the script via the dash-node Rebuild (K2GO-440, no rebake). Does NOT change WHY a module-install seed fails (root cause still open, K2GO-450): it makes that failure fast, visible, and diagnosable. (K2GO-450)
87
- **1.3.13** - Forgejo repo refresh on the durable job engine (K2GO-443). `forgejo` is now a job type: `POST /forgejo/download` plus `GET /forgejo/jobs/:id` (structured `{phase, percent, detail}`) and retry/cancel over the generic `/:type/*` surface. The runner (`sockets/forgejo.exec.ts`) wraps the existing box orchestration (`static/forgejo/orchestration` -> `refresh_forgejo`) and reports per-repo progress (repo N of M + the current repo name) parsed from a new `K2GO_PROGRESS` marker the orchestration emits. Forgejo is a git operation (fetch + fast-forward/merge + authenticated push per seeded example repo), not a file download, so there is NO aria2 and NO pause/resume; retry re-runs the idempotent refresh. The seed (install) path is unchanged. The older `POST /forgejo/refresh` (wrapper) stays for now. Localhost-only. (K2GO-443)
98
- **1.3.12** - Add-ons gallery download on the durable job engine (K2GO-443). `code-addons` is now a job type: `POST /code-addons/download` plus `GET /code-addons/jobs/:id` (structured `{phase, percent, speed, detail}`) and pause/resume/retry/cancel over the generic `/:type/*` surface, like build-assets. The runner (`sockets/code_addons.exec.ts`) downloads only the heavy add-on binaries (.cgp + source tarballs) with aria2c (resilient: `--continue` resume, survives a network change) using the shared `downloadWithAria2` helper; the mirror stages the small files (shell, catalog, icons, pages) with its Cloudflare clean + catalog base rewrite and prints the aria2 input for the heavy ones (`mirror_addons.py --print-aria2-input`), then verifies them (`--finalize-only`), and the runner swaps the staged tree in atomically. The older `POST /addons/refresh` (wrapper) stays for now. Localhost-only. (K2GO-443)
109
- **1.3.11** - Build-assets download on the durable job engine (K2GO-443). `code-assets` is now a job type: `POST /code-assets/download` plus `GET /code-assets/jobs/:id` (structured `{phase, percent, speed, detail}`) and pause/resume/retry/cancel over the generic `/:type/*` surface, like kiwix/maps. The runner (`sockets/code_assets.exec.ts`) downloads the build assets with aria2c (resilient: `--continue` resume, survives a full interface loss via the outer retry loop) using the shared `downloadWithAria2` helper, then the mirror verifies each file against its published `.md5` and writes the browse page (`mirror_code_assets.py --finalize-only`), and the runner swaps the staged tree in atomically. The older `POST /code-assets/refresh` (wrapper) stays for now. Localhost-only. (K2GO-443)

‎static/dashboard/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dashboard-console",
3-
"version": "1.3.14",
3+
"version": "1.3.13",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

‎tools/forgejo-seed.sh‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,7 @@ STATUS=/var/run/forgejo-seed.status
1919
LOG=/var/log/forgejo-seed.log
2020
ORCH=/opt/iiab-android/static/forgejo/orchestration
2121

22-
# K2GO-450: never leave the status stuck on "running". A seed that dies abnormally (an unbound
23-
# var under "set -u", a sourced-file abort, any step that exits the shell) skips the explicit
24-
# done/error writes below, so without this trap the status sticks on "running" and the app polls
25-
# a dead seed for ~20 min. On ANY exit still marked "running", record "error" plus a breadcrumb,
26-
# so the state is always terminal and the app fails fast (it already treats "error" as failure).
27-
# A SIGKILL cannot be trapped, but a detached seed (setsid) is not SIGKILL'd by a dash-node
28-
# restart, so the trappable deaths are the ones that matter here.
29-
finish() {
30-
rc=$?
31-
if [ "$(cat "$STATUS" 2>/dev/null)" = running ]; then
32-
echo error > "$STATUS" 2>/dev/null || true
33-
echo "forgejo-seed: abnormal exit (rc=$rc) before a terminal status" >> "$LOG" 2>&1
34-
fi
35-
}
36-
trap finish EXIT
37-
3822
: > "$LOG" 2>/dev/null || true
39-
echo "forgejo-seed: start $(date -u '+%Y-%m-%dT%H:%M:%SZ')" >> "$LOG" 2>&1
4023
echo running > "$STATUS" 2>/dev/null || true
4124

4225
{

0 commit comments

Comments
 (0)