feat: Delta schema evolution (#35), transient job retry (#40), and eviction self-cancel fix (#39)#41
Merged
Conversation
…#39) - #39: exclude current-run jobs from quota-eviction victims via is_self_job (_active_jobs registry + related.runId), so eviction never cancels our own in-flight work. - #40: add growable DEFAULT_JOB_RETRY_RULES regex data structure and MessageRetryPolicy.for_job_retry; execute() re-submits a job on a matching transient failure. New job_retry_* profile config + README docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…akes - imds_relay_router.py: per-resource thread-safe TokenCache (300s skew), upstream retry (3x capped backoff), never return an empty token as 200, ThreadingHTTPServer for pytest -n 32 concurrency. Collapses ~120 relay calls (~17% 500 rate) to ~4 cached fetches. - gci.yaml: top-level concurrency cancel-in-progress; retry az login --identity. - Add focused TokenCache unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
This PR delivers three related features for the SCOPE adapter. All logic is unit-tested and the full integration suite passes locally (
-n 32, GREEN).1. Delta Lake schema evolution — Closes #35
Before building each SCOPE script, the adapter diffs the model's
delta_table_columnsagainst the live Delta table schema (read with DuckDB, after confirming_delta_logexists on ADLS):ALTER TABLE @target ADD COLUMN IF NOT EXISTS <name> <type>;so the table evolves before theINSERT.DbtRuntimeErrorshowing both schemas.long≡ DeltaBIGINT)._delta_log(new table) → no-op;CREATE TABLEcreates the full schema.Applies to both
incrementalandtable(full-refresh) materializations. No new dependency (reuses the existing DuckDB + ADLS introspection).2. Avoid self-cancel in quota eviction — Closes #39
The quota-eviction layer now excludes the current dbt run's own jobs from victim selection via
is_self_job(job)— true if the job is in the process_active_jobsregistry or itsrelated.runId == _run_id. So eviction never cancels our own in-flight work.3. Retry transient SCOPE job failures via a RegEx rule set — Closes #40
A curated, growable
RetryRule(name, pattern, description)data structure (DEFAULT_JOB_RETRY_RULESinmessage_retry.py), seeded conservatively with:Exception in VertexManager ... Failed to open stream ... Operation timed outJob cancelled by user ...(external/cross-pipeline cancels — the fix: Do not cancel self job #39 fallback)MessageRetryPolicy.for_job_retry()merges built-ins with user-configuredjob_retry_on_messages;execute()wrapssubmit_and_waitso a matching job failure re-submits a fresh job with capped exponential backoff. Non-matching failures propagate unchanged. To grow coverage later, append aRetryRule.New profile config:
enable_job_retry,job_retry_on_messages,job_retry_max_attempts,job_retry_initial_wait_seconds,job_retry_max_wait_seconds(all validated).Testing
ruff check+ruff format --check: cleanfor_job_retry; credentials validation;execute()re-submit-on-match / no-retry-on-fatal)-n 32): 4 passed — including a newTestSchemaEvolution(datagen v1 → datagen v2 → assertregion_nameevolved in and populated), andTestIncremental(re-runs guard against type-check false positives)Closes #35
Closes #39
Closes #40