fix(masters): retry transient hydration races - #833
Merged
Conversation
…rify budget Issue #829 reported four failure shapes on long sequential Masters batch runs; the previous commit on this branch (b34297a) fixed only two (menu-item-not-found, contenteditable clear). This closes the remaining two, including the most frequent one: - archive_master: the pre-click TOCTOU re-check (_reverify_status_or_raise) raised immediately when the overview page's status text was transiently unrecognised, even though its own internal 60s hydration poll had already run out — a single dead-end, not a real "another session changed it" signal. archive_master now retries the whole open-menu -> re-verify -> click sequence once more via a fresh page re-navigation (_click_menu_item_with_reverify_retry), while the genuine "status changed to something else" TOCTOU case still aborts immediately, never retried (new _TransientUnrecognisedStatusError distinguishes the two). copy_master is deliberately left out: it is non-idempotent, so retrying through a false "changed" reading risks a worse failure (a duplicate campaign) than reporting it. - update_master's post-save verify (_verify_saved): the existing reload-retry budget (_VERIFY_RELOAD_MAX_ATTEMPTS, added for issue #790) already re-navigates on a stale post-save read, but 3 attempts still wasn't enough headroom for a busier account under sustained sequential load per issue #829's log. Raised to 4. Tests: TestArchiveMaster::test_retries_transient_unrecognised_status_ before_archiving, TestVerifyTrackingParamsReloadRetry:: test_recovers_after_multiple_consecutive_stale_reads — both red before the fix (verified), and mutation-checked (reverting the constants back makes them fail again for the right reason). Verified: 894/894 tests/test_masters.py pass, 3543/3543 full suite pass, black + flake8 clean, git diff --check clean. Closes #829
Owner
Author
🔍 Local review (cycle 1) — round 13a681d2-a036-4bce-b1ec-e296c5634dc8Reviewed locally (
Totals: 0 FIX, 1 SKIP, 1 HALLUCINATION, 0 UNVERIFIED. |
Owner
Author
📋 Review summary — all cycles
Totals: 1 FIX (all resolved), 1 SKIP, 1 HALLUCINATION, 0 UNVERIFIED. |
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.
Closes #829
Summary:
Tests: