You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: measure SQL Server MCP read-safety controls and process topology against a local container #9892
Refs #5940. Slice 4 of 7. Blocked by #9849 (slice 2, the server). Runs in parallel with slice 3.
Problem
#5940 S3 and F10 require read-safety defaults and the process topology to be backed by a recorded local measurement before they become defaults. Read Committed Snapshot Isolation is off on SQL Server including the Linux container, so plain reads take shared locks there.
Fix
Add a measurement script in the plugin that, against a local SQL Server Linux container:
runs the read tool against a table while a second session updates it, with and without each read control the ADR chose (LOCK_TIMEOUT, pinned isolation, row cap with prompt cancel, request timeout with rollback), and records blocked time, lock waits, and any transaction left open (sys.dm_tran_session_transactions) after a timeout;
starts N concurrent server processes (per-session topology) against the same database and records connection count and blocking.
Write the results and the chosen defaults to a doc in the plugin (docs/ or reference/), dated, with the container image tag. Set the server's defaults to the measured values.
Done when
The measurement script named in the doc exits 0 on a Linux host with Docker and writes its result table
The doc's table shows zero open transactions after a forced timeout with the chosen defaults: grep -c 'open transactions after timeout: 0' <doc> prints 1 or more
The server's default values match the doc's chosen row (a unit test asserts each default)
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: High
Uncertainty: Knowable
Flags: none
Blocked by: #9849
Understood: add a measurement script to the SQL Server MCP plugin. It runs against a local SQL Server Linux container and compares read controls (lock timeout, pinned isolation, row cap, request timeout) and per-session process topology. It writes a dated results doc with the image tag and sets the server defaults to the measured values, with a unit test per default. This depends on the server from #9849, which is still open. The Docker-host run in the first done-when item can't be done by an unattended lane run, so that part is held for a person.
The work-resolve-issue lane stopped on this issue (host-only): the run reports the work needs a host run the lane cannot make.
It added host-run and removed agent-ready: an agent run on a host builds it, and it waits on no decision from a person.
In the run's words:
host-only: every done-when item but the CI one rests on a recorded run of a new measurement script against a local SQL Server Linux container, and both the doc's result table and the server's new defaults must come from that run. This lane's Bash runs only its named check wrappers, with no docker and no node, so it can neither start the container nor run the script or the plugin's node tests, and writing measured values it did not measure would be made up. A host run with Docker and Node 22 needs to write and run the script, record the dated results with the image tag, and set the defaults from them.
What the run says it did not do:
Done-when 1, the measurement script exiting 0 on a Linux host with Docker and writing its result table: not written, because this lane cannot run Docker or Node to start the container or test the script
Done-when 2, the doc's table showing 'open transactions after timeout: 0' for the chosen defaults: not written, because that line must come from a real run of the script
Done-when 3, the server's defaults matching the doc's chosen row with a unit test per default: not changed, because the chosen row does not exist until the measurement runs
Done-when 4, ci-status green on the PR head: no PR, since nothing changed
tidy, review, verify and checks prep steps: skipped, because the run made no change for them to cover
Host run. The new plugins/sql-server/scripts/measure-read-safety.mjs ran against a local SQL Server 2025 Linux container (Docker, --memory 2g), and its results and the chosen defaults went to PR #11686.
Blocker: #9849 is still open, but only as the tracker. Its decision comment re-pointed this issue to slice C, #11327, which closed on 2026-10-31 when #11550 merged. The server and executor are on main.
What ran (Claude Code 2.1.316, Node 24, Docker 29.9.2):
npm ci --ignore-scripts --no-audit --no-fund in plugins/sql-server.
node scripts/measure-read-safety.mjs against mcr.microsoft.com/mssql/server:2025-CU8-ubuntu-24.04 (sha256:4bab24f3…d512e1), SQL Server 17.0.4075.5 Developer, with RCSI, ADR and optimized locking off. Each run created a container with a generated name and an SA password generated for that run, never written or logged, and removed the container when it finished. The final run exited 0 and rewrote the results block of plugins/sql-server/reference/read-safety-measurement.md.
npm test --prefix plugins/sql-server: 125 passed. Changing the doc's chosen lockTimeoutMs made defaults.test.mjs fail.
scripts/check-affected.sh --tests on the committed head: 13 passed, 3 skipped. check-cant-fail-scan.sh and check-test-tmp-cleanup.sh --check were clean.
Key numbers:
With no controls, a read blocked for the writer's full 8000 ms hold. Lock timeouts of 500 to 5000 ms ended the read within 83 ms of the value, and request timeouts of 1000 and 3000 ms within 72 ms. Every one left 0 open transactions.
A raw session cancelled inside BEGIN TRAN with XACT_ABORT OFF and kept open held 1 transaction. That is what the executor's discard rule prevents.
A writer waited 4 ms on a READ COMMITTED reader transaction and about 3000 ms under REPEATABLE READ or SERIALIZABLE.
The row cap cancelled promptly: 1000 rows took 60 ms, against 277 ms for all 200000.
Forced timeouts at the shipped defaults: lock timeout at 5079 ms and request timeout at 30205 ms, each with open transactions after timeout: 0.
Topology: 2 sessions per busy process. With 1 or 2 processes no request was blocked. With 4 and 8 processes up to 2 and 5 requests were briefly blocked, and the writer's slowest update was 217 ms.
Defaults: the measurement backs the existing values, which are no longer provisional: 30000 ms request timeout, 5000 ms lock timeout, 1000-row cap, READ COMMITTED, pool of 2, 30000 ms idle close, and one process per registration.
Done when:
The script named in the doc exits 0 on a Linux host with Docker and writes its result table.
grep -c 'open transactions after timeout: 0' on the doc prints 2.
The server defaults match the doc's chosen row, and test/defaults.test.mjs asserts each one.
Host run, correction. The figures in the earlier host-run comment came from a run before review fixes. The final script on #11686 head 21ef5ba was rerun: forced timeouts at the defaults read 5076 ms (lock) and 30154 ms (request), each with open transactions after timeout: 0; at 8 processes 1 request was briefly blocked and the writer's slowest update was 162 ms. The PR body and the plugin doc carry the committed results; the defaults are unchanged.
Activity
github-actions commentedon Oct 24, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Medium
Complexity: High
Uncertainty: Knowable
Flags: none
Blocked by: #9849
Understood: add a measurement script to the SQL Server MCP plugin. It runs against a local SQL Server Linux container and compares read controls (lock timeout, pinned isolation, row cap, request timeout) and per-session process topology. It writes a dated results doc with the image tag and sets the server defaults to the measured values, with a unit test per default. This depends on the server from #9849, which is still open. The Docker-host run in the first done-when item can't be done by an unattended lane run, so that part is held for a person.
Automated triage, applied by the lanes App.
melodic-automation-lanes commentedon Oct 24, 2026
Not admitted to the issue lane yet: blocker #9849 is not closed by a listed human or a merge.
2 remaining items
github-actions commentedon Oct 31, 2026
github-actions commentedon Oct 31, 2026
melodic-automation-lanes commentedon Oct 31, 2026
The work-resolve-issue lane stopped on this issue (
host-only): the run reports the work needs a host run the lane cannot make.It added
host-runand removedagent-ready: an agent run on a host builds it, and it waits on no decision from a person.In the run's words:
What the run says it did not do:
Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41231391132
To hand it back to the lane, remove
host-runand addagent-readyagain.kyle-sexton commentedon Oct 31, 2026
Host run. The new
plugins/sql-server/scripts/measure-read-safety.mjsran against a local SQL Server 2025 Linux container (Docker,--memory 2g), and its results and the chosen defaults went to PR #11686.Blocker: #9849 is still open, but only as the tracker. Its decision comment re-pointed this issue to slice C, #11327, which closed on 2026-10-31 when #11550 merged. The server and executor are on
main.What ran (Claude Code 2.1.316, Node 24, Docker 29.9.2):
npm ci --ignore-scripts --no-audit --no-fundinplugins/sql-server.node scripts/measure-read-safety.mjsagainstmcr.microsoft.com/mssql/server:2025-CU8-ubuntu-24.04(sha256:4bab24f3…d512e1), SQL Server 17.0.4075.5 Developer, with RCSI, ADR and optimized locking off. Each run created a container with a generated name and an SA password generated for that run, never written or logged, and removed the container when it finished. The final run exited 0 and rewrote the results block ofplugins/sql-server/reference/read-safety-measurement.md.npm test --prefix plugins/sql-server: 125 passed. Changing the doc's chosenlockTimeoutMsmadedefaults.test.mjsfail.scripts/check-affected.sh --testson the committed head: 13 passed, 3 skipped.check-cant-fail-scan.shandcheck-test-tmp-cleanup.sh --checkwere clean.Key numbers:
BEGIN TRANwithXACT_ABORT OFFand kept open held 1 transaction. That is what the executor's discard rule prevents.READ COMMITTEDreader transaction and about 3000 ms underREPEATABLE READorSERIALIZABLE.open transactions after timeout: 0.Defaults: the measurement backs the existing values, which are no longer provisional: 30000 ms request timeout, 5000 ms lock timeout, 1000-row cap,
READ COMMITTED, pool of 2, 30000 ms idle close, and one process per registration.Done when:
grep -c 'open transactions after timeout: 0'on the doc prints 2.test/defaults.test.mjsasserts each one.ci-statusgreen on the PR head: pending. PR test(sql-server): measure read-safety controls and process topology against a local container #11686 is ready at003a85f36f; nothing has merged.Not verified:
tediousthat trusts the container's self-signed certificate, becauseconfig.v1has no option for that.@@TRANCOUNTcheck was not reached. Throughquery, error 266 stops a statement that opens a transaction first.IDLE_TIMEOUT_MSwas not stressed.PR: #11686
Target labels: add none; remove host-run.
fix(sql-server): exempt the measurement script's docker call from the…
fix(sql-server): sample open transactions before closing the executor
chore(sql-server): drop the docker exemption now that prerequisites.j…
fix(sql-server): clean up a failed measurement run and stop quoting o…
kyle-sexton commentedon Oct 31, 2026
Host run, correction. The figures in the earlier host-run comment came from a run before review fixes. The final script on #11686 head 21ef5ba was rerun: forced timeouts at the defaults read 5076 ms (lock) and 30154 ms (request), each with
open transactions after timeout: 0; at 8 processes 1 request was briefly blocked and the writer's slowest update was 162 ms. The PR body and the plugin doc carry the committed results; the defaults are unchanged.