{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/5598","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/5598/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/5598/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/5598/events","html_url":"https://github.com/rust-lang/cargo/issues/5598","id":328157706,"node_id":"MDU6SXNzdWUzMjgxNTc3MDY=","number":5598,"title":"`cargo run` kills child processes upon exit","user":{"login":"kuviman","id":5872782,"node_id":"MDQ6VXNlcjU4NzI3ODI=","avatar_url":"https://avatars2.githubusercontent.com/u/5872782?v=4","gravatar_id":"","url":"https://api.github.com/users/kuviman","html_url":"https://github.com/kuviman","followers_url":"https://api.github.com/users/kuviman/followers","following_url":"https://api.github.com/users/kuviman/following{/other_user}","gists_url":"https://api.github.com/users/kuviman/gists{/gist_id}","starred_url":"https://api.github.com/users/kuviman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kuviman/subscriptions","organizations_url":"https://api.github.com/users/kuviman/orgs","repos_url":"https://api.github.com/users/kuviman/repos","events_url":"https://api.github.com/users/kuviman/events{/privacy}","received_events_url":"https://api.github.com/users/kuviman/received_events","type":"User","site_admin":false},"labels":[{"id":84096804,"node_id":"MDU6TGFiZWw4NDA5NjgwNA==","url":"https://api.github.com/repos/rust-lang/cargo/labels/C-bug","name":"C-bug","color":"f5f1fd","default":false},{"id":576467366,"node_id":"MDU6TGFiZWw1NzY0NjczNjY=","url":"https://api.github.com/repos/rust-lang/cargo/labels/E-help-wanted","name":"E-help-wanted","color":"02e10c","default":false},{"id":602512930,"node_id":"MDU6TGFiZWw2MDI1MTI5MzA=","url":"https://api.github.com/repos/rust-lang/cargo/labels/O-windows","name":"O-windows","color":"7e7ec8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-31T14:17:30Z","updated_at":"2018-08-12T04:32:11Z","closed_at":null,"author_association":"NONE","body":"Is this expected behaviour?\r\n\r\n```rs\r\nfn main() {\r\n    std::process::Command::new(\"cmd\").arg(\"/C\").arg(\"start\").arg(\"cmd.exe\").spawn().unwrap();\r\n    std::thread::sleep_ms(1000);\r\n}\r\n```\r\n\r\nRunning this with `cargo run` opens `cmd.exe` for only one second, but running directly via `target/release/project.exe` opens it forever."},"comment":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/comments/412318044","html_url":"https://github.com/rust-lang/cargo/issues/5598#issuecomment-412318044","issue_url":"https://api.github.com/repos/rust-lang/cargo/issues/5598","id":412318044,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjMxODA0NA==","user":{"login":"alexcrichton","id":64996,"node_id":"MDQ6VXNlcjY0OTk2","avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2018-08-12T04:32:11Z","updated_at":"2018-08-12T04:32:11Z","author_association":"MEMBER","body":"@Seeker14491 job objects were originally added to make ctrl-c work across platforms. On Unix ctrl-c kills the *process group*, not a single process, which means everything gets taken down. On Windows however only one process killed, and by using job objects we also guaranteed unix-like behavior of the whole group of processes being killed.\r\n\r\nThe initial implementation simply let the job object kill everything on Windows, even on success. This was a bug at the time and didn't really come up till much later (now). When implementing leaking processes it simply preserved the previous behavior, killing everything on all exits.\r\n\r\nAll that to say, no, there shouldn't be anything that Cargo should kill on successful exits. It should continue to kill everything on abnormal exits though! "}}
{"actor":{"display_login":"alexcrichton"}}