Repository navigation
test(formal): serialize TLC runs and check the jar before caching it - #44
Merged
Merged
Conversation
tlc.sh hashes the download before it moves it into the cache, takes a machine-wide lock so one TLC run goes at a time, and caps workers and heap through TLC_WORKERS and TLC_HEAP. Both check.sh scripts gain --config to run one config and print the tail of TLC's output when a run ends with an unexpected exit code.
Quote measured run times and how load affects them, list Java 11+ or mise, document --config and the TLC lock, map EndTxn and ReporterStart to code, give baseline distinct-state counts for the adapter configs, and explain how to model a guard that changes in one adapter only.
… log early tlc.sh failures ps prints lstart in the caller's TZ and locale, so a run with a different environment took a live lock as stale. TLC_LOG now opens once the lock is taken, so a missing Java or a bad download reaches the check.sh tail.
…-config A SIGTERM to the PID in the wait notice released the lock and left TLC running. tlc.sh now runs TLC as a child, forwards INT, TERM and HUP, and keeps the lock until TLC exits.
Contributor
Author
|
review-gate: passed 6ed6614 Two Fixed:
Open, all low:
|
Contributor
Author
|
verify: PASS+NOTES 141d3e3 Base 280ecbc, patch-id b3da67351c8570b86b612654607eb02b02c0f651 (matches). Independent verifier, not the author. One TLC process at a time, small configs only, load average 10 to 45.
Notes (none block the merge):
After the checks: |
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.
Why
Verifiers who ran the two TLA+ models as new users hit runner faults and skill gaps.
tlc.shcached a jar before it checked its hash. Three TLC runs at once (-workers auto, default heap) drove a 10-core, 32 GiB Mac to load 410 and filled the disk. A TLC crash showed only aserror:1 MISMATCH. This PR fixes those faults, so the next person can run one check without overloading the machine.What changed
tests/formal/tlc.sh:/tmp/backwave-tlc.lock, a symlink created atomically withln -s. Its target is the holder's PID plus itsps -o lstartstart time in a fixed locale, which catches a dead holder and a reused PID. A second run printsWaiting for the TLC run of PID <pid> to finishand polls every 2 s.tlc.shstops TLC before the lock is released.TLC_WORKERS(default half the cores,autofor all),TLC_HEAP(default4g), andTLC_LOG.check.shusesTLC_LOGfor its log, and the wait notice stays on the terminal.check.sh:--config <name>runs one config. On an exit code other than 0 or 12, they print the last 20 lines of TLC's output.--config, the lock and its settings, and measured times with load.EndTxnandReporterStartto code, and says that TLC never reads the C#.Fenceon one adapter.OracleJobStore.cs:1473-1484, matching the spec header and the skill.Tradeoffs
The default is half the cores rather than
auto, because the lock already serializes runs and the machine is shared. I chose a symlink lock overmkdirplus a PID file because it creates the lock and writes the PID in one step.Verification
All runs were on this branch, one at a time, at load averages from 10 to 510.
check.sh. Dead-PID, reused-PID, and mixed-TZ/locale locks behave as described. SIGTERM and SIGINT stop TLC (exit 143) and release the lock.TLC_HEAPand a missing Java each print their reason in the tail of both scripts.lease-fencing/check.sh --all: 17 of 17 rows match. oracle 14,110,656, postgres 1,947,808, sqlserver 2,698,212. I reran the three adapters on the finaltlc.shwith the same counts.commit-horizon/check.sh --deep: 17 of 17 runs ok,check passed.