Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature Request: More durable/predictable development registry for workers #5112

Open
mhamann opened this issue Feb 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mhamann
Copy link

mhamann commented Feb 27, 2024

Problem

When running multiple workers locally, the first wrangler process to start becomes the host for the dev registry. All other wrangler processes then register their workers with this "leader" process/registry.

This can lead to some confusing development situations where the order of operations is important. For example, if I shut down or restart that initial wrangler process, the registry is lost and all of my other workers have to be restarted in order to re-create it. I didn't realize this is how it worked until I took a deeper look at the workers sdk source.

Describe the solution

Instead of a transient store, it would be preferable if each wrangler process can register its workers in a registry that is independent of which process is actually running.

I imagine that this might be a file structure on disk. Something like ~/.wrangler/registry. Each process can register its workers there on startup and then clean them up on shutdown. This enables wrangler processes to start and stop at will without worrying about order of execution. It also provides more reliable linking of services during local development.

It might also be useful if the registry could contain pointers to workers running remotely in Cloudflare in order to enable mixed-mode development.

Related to #1182

@mhamann mhamann added the enhancement New feature or request label Feb 27, 2024
@mrbbot
Copy link
Contributor

mrbbot commented Feb 28, 2024

Hey! 👋 I've got a WIP PR that does something similar to this: #4241. Instead of treating the first process as the "leader", the first process will spawn a background daemon registry process that will outlive it if other wrangler dev sessions are still running. We prioritised some other dev-related work, so wasn't able to land this back then, but hoping to revisit this soon. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants