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

🐛 BUG: Worker Registry fails to start(concurrent dev sessions) #6037

Closed
helloimalastair opened this issue Jun 14, 2024 · 3 comments · Fixed by #5214
Closed

🐛 BUG: Worker Registry fails to start(concurrent dev sessions) #6037

helloimalastair opened this issue Jun 14, 2024 · 3 comments · Fixed by #5214
Assignees
Labels
bug Something that isn't working

Comments

@helloimalastair
Copy link
Contributor

helloimalastair commented Jun 14, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

3.60.3

What version of Node are you using?

22.2.0

What operating system and version are you using?

MacOS Sonoma 14.5

Describe the Bug

Observed behavior

When starting multiple wrangler dev processes in quick succession(via a tool like turbo or similar), the sessions can end up fighting over which of them gets to start the Registry. Others fail with the error

 ✘ [ERROR] failed to start worker registry Error: listen EADDRINUSE: address already in use 127.0.0.1:6284

Expected behavior

One of the Dev Sessions should complete, and any others should wait for it to become available before throwing an error.

Steps to reproduce

  1. Create multiple Workers(doesn't matter their content). I did it with 5, but it should work with less/more too.
  2. Start wrangler dev on them all simultaneously.

Credit to @poacher2k for discovering/reporting this bug on the CF Discord.

@helloimalastair helloimalastair added the bug Something that isn't working label Jun 14, 2024
@petebacondarwin
Copy link
Contributor

The plan is to move to a file based registry in the shortish term. (There may be more significant approach to multi-worker development in the longer term). See #5214
I'll see if we can prioritise landing this before the end of the month.

@helloimalastair
Copy link
Contributor Author

Thank you, y'all!

@zygimantas
Copy link

Just in case someone will browse this issue, I was still getting same error with wrangler 3.65.1 with and without --x-registry flag.

My workaround is:

  1. Run worker1 wrangler dev --port=4201 worker1.ts
  2. Run worker2 wait-on tcp:4201 && wrangler dev --port=4202 worker2.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants