{"action":"closed","issue":{"url":"https://api.github.com/repos/MichaelXavier/Angel/issues/40","repository_url":"https://api.github.com/repos/MichaelXavier/Angel","labels_url":"https://api.github.com/repos/MichaelXavier/Angel/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/MichaelXavier/Angel/issues/40/comments","events_url":"https://api.github.com/repos/MichaelXavier/Angel/issues/40/events","html_url":"https://github.com/MichaelXavier/Angel/issues/40","id":78988850,"number":40,"title":"TERM/INT signals do not propagate to children","user":{"login":"proger","id":66214,"avatar_url":"https://avatars.githubusercontent.com/u/66214?v=3","gravatar_id":"","url":"https://api.github.com/users/proger","html_url":"https://github.com/proger","followers_url":"https://api.github.com/users/proger/followers","following_url":"https://api.github.com/users/proger/following{/other_user}","gists_url":"https://api.github.com/users/proger/gists{/gist_id}","starred_url":"https://api.github.com/users/proger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proger/subscriptions","organizations_url":"https://api.github.com/users/proger/orgs","repos_url":"https://api.github.com/users/proger/repos","events_url":"https://api.github.com/users/proger/events{/privacy}","received_events_url":"https://api.github.com/users/proger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"ignesco","id":736075,"avatar_url":"https://avatars.githubusercontent.com/u/736075?v=3","gravatar_id":"","url":"https://api.github.com/users/ignesco","html_url":"https://github.com/ignesco","followers_url":"https://api.github.com/users/ignesco/followers","following_url":"https://api.github.com/users/ignesco/following{/other_user}","gists_url":"https://api.github.com/users/ignesco/gists{/gist_id}","starred_url":"https://api.github.com/users/ignesco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignesco/subscriptions","organizations_url":"https://api.github.com/users/ignesco/orgs","repos_url":"https://api.github.com/users/ignesco/repos","events_url":"https://api.github.com/users/ignesco/events{/privacy}","received_events_url":"https://api.github.com/users/ignesco/received_events","type":"User","site_admin":false},"assignees":[{"login":"ignesco","id":736075,"avatar_url":"https://avatars.githubusercontent.com/u/736075?v=3","gravatar_id":"","url":"https://api.github.com/users/ignesco","html_url":"https://github.com/ignesco","followers_url":"https://api.github.com/users/ignesco/followers","following_url":"https://api.github.com/users/ignesco/following{/other_user}","gists_url":"https://api.github.com/users/ignesco/gists{/gist_id}","starred_url":"https://api.github.com/users/ignesco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignesco/subscriptions","organizations_url":"https://api.github.com/users/ignesco/orgs","repos_url":"https://api.github.com/users/ignesco/repos","events_url":"https://api.github.com/users/ignesco/events{/privacy}","received_events_url":"https://api.github.com/users/ignesco/received_events","type":"User","site_admin":false}],"milestone":null,"comments":18,"created_at":"2015-05-21T13:08:09Z","updated_at":"2016-09-10T14:20:22Z","closed_at":"2016-09-10T14:20:22Z","body":"Hi,\r\n\r\nI think I found a severe issue in Angel:\r\n\r\nSteps to reproduce:\r\n\r\n1. run angel with a single arbitrary process\r\n2. send a parent angel either TERM or INT signal (^C won't work because it sends INT to the whole *process group*)\r\n3. watch the parent orphan its children\r\n\r\n```\r\n% pstree -p $(pgrep angel | head -1)\r\n-+= 00001 root /sbin/launchd\r\n \\-+= 00341 vladki /Applications/iTerm.app/Contents/MacOS/iTerm -psn_0_40970\r\n   \\-+= 00453 root login -fp vladki\r\n     \\-+= 00456 vladki -zsh\r\n       \\-+= 03508 vladki dist/build/angel/angel -v2 stubborn.conf\r\n         \\-+- 03509 vladki dist/build/angel/angel -v2 stubborn.conf\r\n           \\--- 03510 vladki test/test_jobs/StubbornJob\r\n% kill -TERM 3508\r\n% pstree -p $(pgrep angel | head -1)\r\n-+= 00001 root /sbin/launchd\r\n \\-+- 03509 vladki dist/build/angel/angel -v2 stubborn.conf\r\n   \\--- 03510 vladki test/test_jobs/StubbornJob\r\n```\r\n\r\nExtended logs:\r\n\r\n```\r\n[2015/05/21 14:48:43] {main} INT | TERM received; initiating shutdown...\r\n[2015/05/21 14:48:43] {main}   1. Clearing config\r\n[2015/05/21 14:48:43] {main}   2. Forcing sync to kill running processes\r\n[2015/05/21 14:48:43] {process-monitor} Must kill=0, must start=0\r\n[2015/05/21 14:48:43] {main} That's all folks!\r\n```\r\n\r\nAnticipated cause:\r\n\r\nAngel tries to [modify](https://github.com/MichaelXavier/Angel/blob/master/src/Angel/Job.hs#L137) a `TVar` [inside `forkProcess`](https://github.com/MichaelXavier/Angel/blob/master/src/Angel/Job.hs#L155-L171) that obviously doesn't modify a parent process' `TVar`.\r\n\r\nA current workaround is to simply kill the whole process group of Angel, but this is definitely not the cleanest solution.\r\n"}}
{"actor":{"display_login":"ignesco"}}