Persist Apps Script quota quarantine across restarts#152
Draft
poulcarlsen53 wants to merge 1 commit into
Draft
Conversation
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.
Summary
Adds optional persistence for confirmed Apps Script quota exhaustion.
When a relay response body is classified as quota exhaustion, the client quarantines that deployment/account until the local quota reset estimate and writes the quarantine state atomically. On restart it restores only still-active quota quarantines. Transient network failures and generic HTTP 403s remain normal bounded backoff, so this should not turn permission mistakes or temporary errors into all-day lockouts.
Why
In multi-deployment setups, restarting the client while one account is quota-dead can immediately hammer the bad account again and make healthy deployments feel worse. Persisting only confirmed quota walls lets the client avoid known-dead accounts after restart while keeping transient failures recoverable.
Details
quota_state_pathto the client config. The default is.goose-quota-state.jsonbeside the client config; an empty value disables persistence.script_keysinclude account labels.Validation
go test -count=1 ./internal/carrier ./internal/configgo test -count=1 ./...