Repository navigation
to 3.0: fix: preserve task store during refresh - #24145
Merged
mergify[bot] merged 3 commits intoApr 15, 2026
Merged
mergify[bot] merged 3 commits into
mergify[bot] merged 3 commits into
Conversation
Keep the current task store alive until a new one has been created successfully. This prevents stale refresh requests or failed refresh attempts from leaving SQL task execution paths with a closed database handle. Add regression tests for stale refresh and store creation failure. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Fixes a task-service refresh bug where refreshableTaskStorage.refresh() could close the active task store before confirming the refresh request was still current and before successfully creating a replacement store, which could surface later as sql: database is closed.
Changes:
- Rework
refreshableTaskStorage.refresh()to only close the previous store after successfully creating and installing a replacement, and to re-check staleness/closed state before swapping. - Add regression tests covering stale refresh requests and store creation failure to ensure the current store remains usable.
- Tighten store identity assertions in existing refresh tests (
assert.Same).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/taskservice/task_service_holder.go | Adjusts refresh flow to preserve the current store until a valid replacement is ready and installed. |
| pkg/taskservice/task_service_holder_test.go | Adds regression tests for stale refresh + create-failure paths and updates assertions for store identity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
XuPeng-SH
approved these changes
Apr 15, 2026
Contributor
Merge Queue Status
This pull request spent 36 seconds in the queue, including 5 seconds running CI. Required conditions to merge
|
1 task done
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #24144
What this PR does / why we need it:
This fixes the task-service bug that showed up in PR #24141's compose CI as
execute task sql_task_overlap->sql: database is closed.refreshableTaskStorage.refresh()was closing the current store before it confirmed that:That meant a stale refresh request or a failed store recreation could leave the holder pointing at a closed task store, and later SQL task execution paths would observe
sql: database is closed.This change keeps the existing store alive until a replacement is ready and the refresh request is still valid, and adds regression tests for stale-refresh and create-failure paths.