Claim a library for a branch, not for a configuration - #305
Merged
Conversation
Two machines testing master both claimed five of the same libraries and tested them twice. #303 fixed the confighash being different for no reason; these five differ for a real one. They are the libraries whose reference files come from MAP-LIB_ReferenceResults/v4.1.0, which a maintenance job updates from time to time, and the two machines had fetched them either side of such an update. The libraries pinned to v4.0.0 and v3.2.3, which do not move, agreed. So the configuration really did differ, and the claim was keyed by it: PRIMARY KEY (branch, libname, libversion, omcversion, confighash) which is finer than the question a claim answers. Whether this machine may test this library of this branch has nothing to do with which reference files it has; that belongs to the two questions that are keyed by the configuration and stay as they are - whether results for an exact configuration already exist, and whether two runs' rows can collide. The claim is now one row per (branch, libname). The versions are kept as columns, so a run still says who is testing what and since when. An existing job_claim is narrowed on connect, keeping the freshest claim per library so that a run in progress does not lose its claims and let a second machine in. Checked against a database seeded the way production looks: the live claim survives the migration, the key becomes (branch, libname), a second machine with a different confighash is refused and told who holds it, a free library is granted and then refused to the first machine, and after release the other machine may take it. Plus a sqlite3 run through the CI configuration and a PostgreSQL run with two FMI simulators. --- Generated by Claude Code.
adrpo
enabled auto-merge (squash)
August 11, 2026 19:41
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.
Two machines testing
masterat the same time still claimed five of the same libraries and tested them twice:Same compiler, same library version — a different
confighash, which is part of the claim key.#303 fixed a
confighashthat differed for no reason (it contained an absolute path). These five differ for a real reason. They are exactly the libraries whose reference files come fromMAP-LIB_ReferenceResults/v4.1.0, which a maintenance job updates from time to time, and the two machines had fetched them either side of such an update. The libraries pinned tov4.0.0andv3.2.3+build.4, which do not move, agreed on 91 of 96 claims.So the configurations genuinely differed — and the claim was keyed by the configuration:
PRIMARY KEY (branch, libname, libversion, omcversion, confighash)That is finer than the question a claim answers. There are three questions here, and only two of them are about the configuration:
(branch, libname)+ libversion, omcversion, confighash(date, libname, model)The second and third are unchanged. Only the claim is narrowed, to one row per
(branch, libname). The versions stay as columns so a run can still report who is testing what, and since when.Migrating
An existing
job_claimis narrowed when a run connects, keeping the freshest claim per library rather than dropping the table — otherwise migrating would release the claims of a run in progress and let a second machine straight in.Checked
Against a database seeded to look like production, with a live claim in the old five-column shape:
plus a sqlite3 run through the CI configuration with its assertion, and a PostgreSQL run with two FMI simulators that releases its claim as
done.Worth knowing separately
The two machines are currently comparing against different v4.1.0 reference files. That is not only a claiming problem: the same model can pass on one machine and fail on the other for that reason alone, and a regression report pairing those two runs would show differences that are not OpenModelica's doing.
Generated by Claude Code.