Open jcf opened 10 months ago
I haven't delved into how devenv manages processes, but whatever the process manager is should likely be configured to try SIGTERM first, then SIGKILL if the process doesn't die after some number of seconds.
But that's a belt and suspenders thing and it will always likely be best to try to fix whatever is trying-to-die to handle SIGTERM properly.
EDIT: after reading the OP more carefully, I see that it's actually probably the process manager itself that is failing here. Yikes.
Maybe we should switch to https://github.com/F1bonacc1/process-compose by default
Maybe we should switch to https://github.com/F1bonacc1/process-compose by default
Bit biased but heavy +1 to that. I would also recommend an eager-evaluation strategy to the process-compose.yml file along with it.
This avoids the costly 'devenv up' nix eval penalty for the most common use-cases.
process-compose looks ok (although, at the moment, the "settings.tui" switch is broken; it always starts with the TUI).
FWIW, one thing I'd like to see from whatever proc manager we use as default is a way to use a UNIX domain socket instead of an HTTP port for client/server communication, to make it possible to have more than one project running at a time without needing to remember to change the port.
(although, at the moment, the "settings.tui" switch is broken; it always starts with the TUI).
I was incorrect, it works. I was just putting the flag in the wrong place.
My complaint about honcho not stopping its subprocesses while running devenv test is also wrong. This happens with hivemind, overmind, and process-compose too, I think it's some sort of race condition in cli.py.
Fixed in #934
Not quite. The OP was about pressing ctrl-C when devenv up
is started without -d
. #934 only applies to devenv up -d
. This issue remains, and it's a honcho issue.
Describe the bug
Attempting to kill running processes with ctrl-c results in an exception from Python:
A second attempt to ctrl-c tells the user the expected PID file does not exist:
At this point you're stuck and have to
kill -9
the process.To reproduce
``` { "nodes": { "devenv": { "inputs": { "flake-compat": "flake-compat", "nix": "nix", "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks" }, "locked": { "lastModified": 1703939110, "narHash": "sha256-GgjYWkkHQ8pUBwXX++ah+4d07DqOeCDaaQL6Ab86C50=", "owner": "cachix", "repo": "devenv", "rev": "7354096fc026f79645fdac73e9aeea71a09412c3", "type": "github" }, "original": { "owner": "cachix", "repo": "devenv", "type": "github" } }, "flake-compat": { "flake": false, "locked": { "lastModified": 1673956053, "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { "owner": "edolstra", "repo": "flake-compat", "type": "github" } }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" }, "locked": { "lastModified": 1704152458, "narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=", "owner": "hercules-ci", "repo": "flake-parts", "rev": "88a2cd8166694ba0b6cb374700799cec53aef527", "type": "github" }, "original": { "id": "flake-parts", "type": "indirect" } }, "flake-utils": { "inputs": { "systems": "systems" }, "locked": { "lastModified": 1685518550, "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "owner": "numtide", "repo": "flake-utils", "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", "type": "github" }, "original": { "owner": "numtide", "repo": "flake-utils", "type": "github" } }, "gitignore": { "inputs": { "nixpkgs": [ "devenv", "pre-commit-hooks", "nixpkgs" ] }, "locked": { "lastModified": 1660459072, "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", "owner": "hercules-ci", "repo": "gitignore.nix", "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", "type": "github" }, "original": { "owner": "hercules-ci", "repo": "gitignore.nix", "type": "github" } }, "lowdown-src": { "flake": false, "locked": { "lastModified": 1633514407, "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", "owner": "kristapsdz", "repo": "lowdown", "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", "type": "github" }, "original": { "owner": "kristapsdz", "repo": "lowdown", "type": "github" } }, "nix": { "inputs": { "lowdown-src": "lowdown-src", "nixpkgs": [ "devenv", "nixpkgs" ], "nixpkgs-regression": "nixpkgs-regression" }, "locked": { "lastModified": 1676545802, "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", "owner": "domenkozar", "repo": "nix", "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", "type": "github" }, "original": { "owner": "domenkozar", "ref": "relaxed-flakes", "repo": "nix", "type": "github" } }, "nixpkgs": { "locked": { "lastModified": 1678875422, "narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=", "owner": "NixOS", "repo": "nixpkgs", "rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-lib": { "locked": { "dir": "lib", "lastModified": 1703961334, "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", "owner": "NixOS", "repo": "nixpkgs", "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", "type": "github" }, "original": { "dir": "lib", "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", "owner": "NixOS", "repo": "nixpkgs", "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", "type": "github" } }, "nixpkgs-stable": { "locked": { "lastModified": 1685801374, "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", "owner": "NixOS", "repo": "nixpkgs", "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_2": { "locked": { "lastModified": 1704194953, "narHash": "sha256-RtDKd8Mynhe5CFnVT8s0/0yqtWFMM9LmCzXv/YKxnq4=", "owner": "NixOS", "repo": "nixpkgs", "rev": "bd645e8668ec6612439a9ee7e71f7eac4099d4f6", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, "pre-commit-hooks": { "inputs": { "flake-compat": [ "devenv", "flake-compat" ], "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": [ "devenv", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable" }, "locked": { "lastModified": 1688056373, "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", "owner": "cachix", "repo": "pre-commit-hooks.nix", "rev": "5843cf069272d92b60c3ed9e55b7a8989c01d4c7", "type": "github" }, "original": { "owner": "cachix", "repo": "pre-commit-hooks.nix", "type": "github" } }, "root": { "inputs": { "devenv": "devenv", "flake-parts": "flake-parts", "nixpkgs": "nixpkgs_2" } }, "systems": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", "repo": "default", "type": "github" } } }, "root": "root", "version": 7 } ```flake.lock
Version