Skip to content

fix: Cleanup redundant batch cleanup mechanisms, improve ListDistinctBatchResources query - #4542

Merged
juliusgeo merged 2 commits into
mainfrom
cleanup_batch_cleanup_queries
Jul 27, 2026
Merged

fix: Cleanup redundant batch cleanup mechanisms, improve ListDistinctBatchResources query#4542
juliusgeo merged 2 commits into
mainfrom
cleanup_batch_cleanup_queries

Conversation

@juliusgeo

Copy link
Copy Markdown
Contributor

Description

2 fixes here:

  1. after_v1_task_runtime_delete_cleanup_batch_runtime already cleans up batch runtime rows once the v1_task_runtime rows are cleaned up, which happens before releaseBatchedQueueItems runs, so we don't need to do it twice.
  2. Improves the ListDistinctBatchResources so it short circuits on the existence of any v1_batched_queue_item row, rather than accumulating all of them. This should help fix worst case performance so that an accumulation of large numbers of v1_batched_queue_item rows doesn't impact this queries' performance.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation change (pure documentation change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking changes to code which doesn't change any behaviour)
  • CI (any automation pipeline changes)
  • Chore (changes which are not directly related to any business logic)
  • Test changes (add, refactor, improve or change a test)
  • This change requires a documentation update

What's Changed

  • Add a list of tasks or features here...

Checklist

Changes have been:

  • Tested (unit, integration, or manually with steps specified)
  • Linted and formatted
  • Documented (where applicable)
  • Added to CHANGELOG (where applicable) -- see Keep a Changelog

🤖 AI Disclosure
  • I acknowledge that an LLM was used in the creation of this Pull Request, in accordance with Hatchet's AI_POLICY.md.
  • Details: [e.g. generating tests, writing docs]

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Jul 27, 2026 3:27pm

Request Review

@github-actions github-actions Bot added the engine Related to the core Hatchet engine label Jul 27, 2026
@juliusgeo
juliusgeo merged commit 559b502 into main Jul 27, 2026
59 of 60 checks passed
@juliusgeo
juliusgeo deleted the cleanup_batch_cleanup_queries branch July 27, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine Related to the core Hatchet engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants