Prove retained connectors close on shutdown

This commit is contained in:
udo
2026-07-20 21:59:32 +00:00
parent 91c745c44b
commit 0c75703186
3 changed files with 41 additions and 10 deletions
+12 -3
View File
@@ -1,6 +1,11 @@
# DOCS-TODO — `/doc` documentation overhaul
# Completed `/doc` documentation overhaul (historical plan)
Briefing for the doc-system overhaul. Read this fully before touching anything.
This June 2026 plan is complete and is retained only as implementation history.
It is not the current task queue and its one-off execution rules do not govern
new UCE work. Current documentation has 269 rendered pages and is covered by
the sharded doc gate in `scripts/run_cli_tests.sh`.
The original briefing follows.
The approved design and the two locked decisions are: **(1) examples are LIVE and
SELF-VERIFYING** — real UCE code executed at render time, showing source + actual
captured output, gated by the test suite; **(2) FULL SWEEP** of all 257 pages.
@@ -163,7 +168,11 @@ and the suite stays green.
```
Expect the current 91 to grow by the new doc gate(s), 0 failed.
## Hard rules (non-negotiable)
## Historical execution rules (no longer active)
These rules applied only while the overhaul was being carried out in June 2026.
They are preserved to explain that work and must not override current repository
or operator instructions.
- **NEVER `git commit`/push/tag.** Not pi, not its subagents, not anyone. Leave a clean
working tree and report.
+7 -6
View File
@@ -14,9 +14,9 @@ Implement the DOCS-TODO.md overhaul for the UCE `/doc` system on the sshfs sourc
## Current State
- Status: verifying; Phase 1 + gate complete, StringList conversion complete, Phase 2 example/filler sweep complete.
- Last updated: 2026-06-16
- Source of truth: `/root/mount_ssh/uce-dev-root-htdocs-uce`
- Status: complete; retained as the implementation record for the June 2026 overhaul.
- Last updated: 2026-07-20
- Source of truth: `/root/mount_ssh/uce-upstream`
- Runtime/live target: `root@10.4.2.110:/Code/uce.openfu.com/uce`
## Goal Tree
@@ -38,10 +38,10 @@ Legend: `[ ]` not started, `[~]` in progress, `[x]` done, `[!]` blocked, `[-]` s
- Done when: CLI runner checks every doc page and examples.
- Verify: full host gate passes.
## Execution Queue
## Completed Execution Queue
1. G2 area batching/delegation now that the mechanism is proven.
2. Keep the host suite green after each area batch.
1. Phase 2 area batching and delegation completed.
2. The host suite and sharded 269-page documentation gate remain the ongoing regression boundary.
## Decisions
@@ -55,6 +55,7 @@ Legend: `[ ]` not started, `[~]` in progress, `[x]` done, `[!]` blocked, `[-]` s
- 2026-06-16: Converted retiring `list_unique/list_sort/list_some/list_every/list_find` free functions to `StringList` methods, updated callers and method docs; full host gate passed: `Summary: 353 passed, 0 failed, 0 skipped`.
- 2026-06-16: Added live examples across types, string, regex, time, markup, noise, uri, and session area pages; full host gate passed: `Summary: 353 passed, 0 failed, 0 skipped`.
- 2026-06-16: Added `:example` blocks to all remaining doc pages, removed full PHP/JS Related Concepts filler, removed duplicate content code fences except resource-bound pages; full host gate passed: `Summary: 353 passed, 0 failed, 0 skipped`.
- 2026-07-20: Marked the finished plan historical so it no longer presents completed work or one-off execution rules as current instructions.
## Change Log
+22 -1
View File
@@ -119,4 +119,25 @@ while (( SECONDS < deadline )); do
done
[[ "$connections" == "0" ]] || { echo "final pooled fixture connection remained after idle eviction" >&2; exit 1; }
echo "Persistent MySQL idle eviction preserved hot reuse and retired the expired connection"
retained=$(request /database.uce)
IFS='|' read -r retained_pid retained_id retained_source <<<"$retained"
[[ "$retained_pid" == "$first_pid" && "$retained_source" == "new" ]]
connections=$(mariadb --batch --skip-column-names -e "SELECT COUNT(*) FROM information_schema.PROCESSLIST WHERE USER='$test_user'")
[[ "$connections" == "1" ]] || { echo "shutdown fixture connection was not retained in the worker pool" >&2; exit 1; }
journal_cursor=$(journalctl -u mariadb.service -n 0 --show-cursor --no-pager | sed -n 's/^-- cursor: //p')
[[ -n "$journal_cursor" ]] || { echo "could not capture MariaDB journal cursor" >&2; exit 1; }
kill -TERM "$server_pid"
deadline=$((SECONDS + 10))
while kill -0 "$server_pid" 2>/dev/null && (( SECONDS < deadline )); do sleep 0.05; done
[[ ! -e "/proc/$server_pid" ]] || { echo "private UCE server did not stop cleanly" >&2; exit 1; }
wait "$server_pid" 2>/dev/null || true
server_pid=""
sleep 1
shutdown_log=$(journalctl -u mariadb.service --after-cursor "$journal_cursor" --no-pager)
if grep -F "$test_user" <<<"$shutdown_log" | grep -Fq "Aborted connection"; then
echo "clean UCE shutdown aborted a retained MySQL connection" >&2
exit 1
fi
echo "Persistent MySQL idle eviction preserved hot reuse, retired expired connections, and closed a retained connection on clean shutdown"