Skip to content

fix: only fetch finalized workflow runs#2896

Merged
abelanger5 merged 3 commits intomainfrom
fix--list-finalize-workflow-run-leak
Jan 31, 2026
Merged

fix: only fetch finalized workflow runs#2896
abelanger5 merged 3 commits intomainfrom
fix--list-finalize-workflow-run-leak

Conversation

@grutt
Copy link
Copy Markdown
Contributor

@grutt grutt commented Jan 30, 2026

Description

In ListFinalizedWorkflowRuns, the code was calling listTaskOutputEvents for ALL tasks passed in, even though verifyAllTasksFinalized had already determined which workflow runs were actually finalized. This meant:

  1. If 1000 workflow runs were being tracked but only 10 were finalized
  2. The system would fetch large payload data for all 1000 workflow runs' tasks
  3. Only the 10 finalized ones would be used; the other 990 were immediately discarded
  4. Each polling iteration (every 1 second) would repeat this, causing 349MB+ of memory allocations that were never needed

The fix filters taskExternalIds to only include tasks belonging to finalized workflow runs before calling listTaskOutputEvents

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@grutt grutt requested a review from abelanger5 January 30, 2026 22:13
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Jan 30, 2026 10:38pm

Request Review

@grutt grutt changed the title only fetch finalized fix: only fetch finalized workflow runs Jan 30, 2026
@abelanger5 abelanger5 merged commit 8186db1 into main Jan 31, 2026
67 of 68 checks passed
@abelanger5 abelanger5 deleted the fix--list-finalize-workflow-run-leak branch January 31, 2026 21:32
@promptless-for-oss
Copy link
Copy Markdown

📝 Documentation updates detected!

New suggestion: Add SERVER_WORKFLOW_RUN_BUFFER_SIZE configuration option


Tip: Use labels in the Promptless dashboard to categorize suggestions by release or team 🏷️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants