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: wrangler dev --experimental-local doesn't cleanly shut down the server #2387

Closed
IgorMinar opened this issue Dec 10, 2022 · 0 comments ยท Fixed by #2400
Closed

๐Ÿ› BUG: wrangler dev --experimental-local doesn't cleanly shut down the server #2387

IgorMinar opened this issue Dec 10, 2022 · 0 comments ยท Fixed by #2400
Labels
bug Something that isn't working

Comments

@IgorMinar
Copy link
Contributor

What version of Wrangler are you using?

2.6.2

What operating system are you using?

Mac

Describe the Bug

wrangler dev --experimental-local                                                                          (master|โ€ฆ6)
 โ›…๏ธ wrangler 2.6.2 
-------------------
workerd/server/server.c++:2138: info: Inspector is listening
[mf:inf] Ready on http://127.0.0.1:8787/
workerd/server/server.c++:967: info: Inspector client attaching [core:user:workers-hot]
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โŽ” Shutting down experimental local server.

When I hit q or ctrl+c, I see Shutting down experimental local server. but the wrangler process never exists on its own. I have to either kill the process or hit ctrl+c again.

@IgorMinar IgorMinar added the bug Something that isn't working label Dec 10, 2022
mrbbot added a commit that referenced this issue Dec 13, 2022
In the bootstrapper script `bin/wrangler.js`, we open an IPC channel,
so IPC messages from the Wrangler process are propagated through the
bootstrapper. Normally, Node's SIGINT handler would close this for
us, but interactive mode enables raw mode on stdin which disables the
built-in handler. This PR calls `process.disconnect()` to close this
channel when we press `x` or CTRL-C, ensuring no open handles, and
allowing for a clean exit.

Closes #2387
mrbbot added a commit that referenced this issue Dec 15, 2022
* Allow `--experimental-local` to cleanly exit on `x`/`CTRL-C`

In the bootstrapper script `bin/wrangler.js`, we open an IPC channel,
so IPC messages from the Wrangler process are propagated through the
bootstrapper. Normally, Node's SIGINT handler would close this for
us, but interactive mode enables raw mode on stdin which disables the
built-in handler. This PR calls `process.disconnect()` to close this
channel when we press `x` or CTRL-C, ensuring no open handles, and
allowing for a clean exit.

Closes #2387

* fixup! Allow `--experimental-local` to cleanly exit on `x`/`CTRL-C`

* fixup! fixup! Allow `--experimental-local` to cleanly exit on `x`/`CTRL-C`

* fixup! Allow `--experimental-local` to cleanly exit on `x`/`CTRL-C`
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
None yet
Development

Successfully merging a pull request may close this issue.

1 participant