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

feat: bench stop #1570

Open
phot0n opened this issue Jul 19, 2024 · 1 comment
Open

feat: bench stop #1570

phot0n opened this issue Jul 19, 2024 · 1 comment

Comments

@phot0n
Copy link
Contributor

phot0n commented Jul 19, 2024

When we abruptly close a terminal window, all the processes spawned via bench start remain running in the background which upon invoking bench start again gives "address already in use" error and fails to spawn.

Gitlab also faced this and they added another service which knows/monitors all the other spawned processes and allows users to stop the process (via a stop command (eg: bench stop)) before trying to start the services again (ref: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/runit.md?ref_type=heads#why-replace-foreman). Maybe we could try something similar?

ps aux | grep -e $(bench pwd) -e $(bench get-redis-ports) and then killing those processes might do but feels very hacky.
Maybe if we keep the process pids somewhere we can then directly kill them when invoking bench stop command?

Maybe we can add signal handler in honcho to handle SIGHUP? which will cause all processes to exit as soon as terminal is closed.

Any/all thoughts are welcome :)

@phot0n phot0n changed the title EADDINUSE when directly closing the terminal instead of SIGTERM-ing bench feat: bench stop Jul 19, 2024
@auliabismar
Copy link

been using this tool

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

No branches or pull requests

2 participants