Fix: Replace firebase PENDING gate with version-based idempotency#267
Open
susilnem wants to merge 1 commit into
Open
Fix: Replace firebase PENDING gate with version-based idempotency#267susilnem wants to merge 1 commit into
susilnem wants to merge 1 commit into
Conversation
…tency The PENDING status guard caused a race: a stats push (only_stats=True) and a status-change push racing for the same project would leave the second push rejected as FAILED, keeping a FINISHED project visible in Firebase.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #267 +/- ##
===========================================
+ Coverage 87.55% 87.68% +0.13%
===========================================
Files 211 212 +1
Lines 12819 12907 +88
Branches 1089 1090 +1
===========================================
+ Hits 11224 11318 +94
+ Misses 1196 1192 -4
+ Partials 399 397 -2 ☔ View full report in Codecov by Harness. |
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.
The PENDING status guard caused a race: a stats push (only_stats=True) and a status-change push racing for the same project would leave the second push rejected as FAILED, keeping a FINISHED project visible in Firebase.
Problem
When a stats push (
only_stats=True) and a status-change push raced for thesame project, the second push hit the PENDING guard and was rejected as FAILED,
leaving a FINISHED project still visible in Firebase.
Changes
Replaced the PENDING status gate with two version counters on
Project:firebase_push_requested_version— bumped atomically by every push triggerfirebase_pushed_version— recorded on success using the snapshot taken attask start (not a re-read), so a concurrent bump can't be marked as satisfied
with stale data
The push task:
pushed_version >= requested_version(already up-to-date, no false FAILED)requested_versiongrew mid-push — heals the silentlock-drop path where a concurrent task is dropped while the lock is held
This PR doesn't introduce any:
printThis PR contains valid: