Skip to content

fix: DB reconnect when re-using runtime#11111

Closed
turadg wants to merge 1 commit intocloudflare:mainfrom
turadg:patch-1
Closed

fix: DB reconnect when re-using runtime#11111
turadg wants to merge 1 commit intocloudflare:mainfrom
turadg:patch-1

Conversation

@turadg
Copy link

@turadg turadg commented Oct 27, 2025

Fixes #9913 , #10506

Adapted from comment by @SyedRFarhan, #9913 (comment)

This doesn't yet have tests. I'm not sure it's the right approach so looking for feedback before investing further.


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: how it's supposed to work
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: used to work

@turadg turadg requested a review from a team as a code owner October 27, 2025 17:10
@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

⚠️ No Changeset found

Latest commit: becdd8d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11111

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11111

miniflare

npm i https://pkg.pr.new/miniflare@11111

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11111

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11111

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11111

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11111

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11111

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11111

wrangler

npm i https://pkg.pr.new/wrangler@11111

commit: becdd8d

@nus25
Copy link

nus25 commented Dec 16, 2025

Looks like these test failures were fixed in #11300.

} else {
log.debug(`Reusing runtime for ${project.relativePath}...`);
// Set same options to reset DB connections
await forEachMiniflare(project.mf, (mf) => mf.setOptions(mfOptions));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should land this as it is since it then makes it the same as when there are changes.

@petebacondarwin
Copy link
Contributor

This is not really the right approach to fixing the problem.
I believe the correct approach is given by #11771.
Closing in favour of that one. It would be great to test out the issues that this PR is trying to solve with that PR's preview.

@github-project-automation github-project-automation bot moved this from Untriaged to Done in workers-sdk Jan 5, 2026
@turadg turadg deleted the patch-1 branch January 5, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

vitest watch fails on the second run using runInDurableObject

3 participants