Repository navigation
🐛 v3: finish an update under the lock, and on the first 3.0 run too - #121
Merged
Merged
Conversation
…0 run too From Codex's review of v3 (gpt-6-sol): - The update's own work (the options delta, plugin/updated.php) ran after the version was stored and the lock released: a failure there was never retried, and another request could go on before it ended. Migrator::migrate() now takes it as a callback, runs it under the lock once the migrations went through and before the version moves; when it throws, the failure is recorded and the next run finishes the update again. - The first 3.0 run of a site updated from 2.x has no stored version, so plugin/updated.php was skipped as if it were an installation, and that update's work was lost. It now runs with $previousVersion null; only a first activation, which is an installation, skips it. Proven live: migrations-live-smoke.sh, the 2.1.0 → 3.0 update through the real upgrader now finishes with plugin/updated.php on the first 3.0 request (33 checks green).
…failure From Codex's second round on v3: when setVersion() failed after the update's work ran, the failure had already been cleared, so every public request found the update due and ran plugin/updated.php again. The version is now stored before the failure is cleared, and a refused write is recorded like any failure: retried by an administrator, at most every RETRY_AFTER.
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.
From the Codex review of
v3(gpt-6-sol, high), after #119.plugin/updated.phpran after the version was stored and the lock released: a failure there was never retried, and another request could proceed before it ended.Migrator::migrate()now takes it as a callback, run under the lock after the migrations and before the version moves; a throw is recorded as the failure and the next run finishes the update again.plugin/updated.php. With no stored version it was taken for an installation. It now runs, with$previousVersionnull; only a first activation skips it.Proof:
composer test257 tests / 700 assertions;migrations-live-smoke.sh33 checks green, including the new one on the real 2.1.0 → 3.0 upgrader path (plugin/updated.phpruns on the first 3.0 request).Refs #40