Repository navigation
Conversation
get_run looked for the id among the 50 newest runs of every pipeline. Once
50 runs had started since, GET /pipeline-runs/{id} returned 404, and run_sync
(the scheduler and nested workflow() path) found nothing and reported the
run as failed even when it had completed.
_create_run now also writes PK=PIPELINERUN#<id>, SK=META holding the run's
sort key, and get_run reads that pointer, then the run. Runs created before
this change have no pointer and are still looked up in the recent window.
start_run and run_sync already hold the sort key, so they read the run
directly with a strongly consistent GetItem. run_sync reads the final status
right after writing it, and an eventually consistent read could return the
earlier "running" item and report ok=false.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 8, 2026
Contributor
|
Thanks! This change is included in #66 (published together with the related platform fixes). This repository is now updated by snapshot PRs only, so closing this one. |
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.
Problem
PipelineService.get_runlooked for the id among the 50 newest runs, across every pipeline (list_runs(limit=50)). Once 50 more runs had started:GET /api/v1/pipeline-runs/{id}returned 404 for a run that exists.run_syncfound nothing, so it reportedok: falsefor a run that had completed.run_syncis the path used by the scheduler and by a script's nestedworkflow()call.On a deployment with a few frequent schedules, 50 runs is a matter of hours.
run_syncalso reads the final status immediately after writing it, using an eventually consistent Query. That can return the earlierrunningitem.Change
_create_runalso writes a pointer itemPK=PIPELINERUN#<run_id>, SK=METAholding the run's sort key.get_runreads the pointer, then the run, so lookup no longer depends on how many runs came after.start_runandrun_syncalready know the sort key, so they read the run directly with a strongly consistentGetItem.There are no schema, Terraform or API changes. The pointer item is about 100 bytes per run.
Test plan
backend/tests/test_pipeline_runs.py, 3 tests:run_syncreportsokfrom a consistent read of the final status.ruffreports no new findings. The two existing findings inpipeline_service.pyare unchanged frommain.This came out of an inventory of DynamoDB access patterns done for the #44 review. It is independent of #44.
🤖 Generated with Claude Code