{"action":"opened","number":405,"pull_request":{"url":"https://api.github.com/repos/CPFL/Autoware/pulls/405","id":79669165,"html_url":"https://github.com/CPFL/Autoware/pull/405","diff_url":"https://github.com/CPFL/Autoware/pull/405.diff","patch_url":"https://github.com/CPFL/Autoware/pull/405.patch","issue_url":"https://api.github.com/repos/CPFL/Autoware/issues/405","number":405,"state":"open","locked":false,"title":"Runtime Manager, terminate_children() changed to as option","user":{"login":"kondoh2","id":9031706,"avatar_url":"https://avatars.githubusercontent.com/u/9031706?v=3","gravatar_id":"","url":"https://api.github.com/users/kondoh2","html_url":"https://github.com/kondoh2","followers_url":"https://api.github.com/users/kondoh2/followers","following_url":"https://api.github.com/users/kondoh2/following{/other_user}","gists_url":"https://api.github.com/users/kondoh2/gists{/gist_id}","starred_url":"https://api.github.com/users/kondoh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kondoh2/subscriptions","organizations_url":"https://api.github.com/users/kondoh2/orgs","repos_url":"https://api.github.com/users/kondoh2/repos","events_url":"https://api.github.com/users/kondoh2/events{/privacy}","received_events_url":"https://api.github.com/users/kondoh2/received_events","type":"User","site_admin":false},"body":">現在、runtime managerからSIGINTでノードを終了する時に、シグナルハンドラが2度呼ばれる状況になっています。\r\n>これは意図している動作なのでしょうか。\r\n \r\n原因および施した対策をお知らせ致します。\r\n\r\n原因\r\n\r\nRuntime Managerから実行したコマンドを終了する際に、\r\nコマンドのプロセスから実行された子プロセス群を先に終了させてから、\r\nコマンドのプロセスを終了させている事に起因してました。\r\n(\"プロセスを終了させる処理\"では、シグナルSIGINTの送出を行なってます)\r\n\r\n実行するコマンドがroslaunchの場合、\r\nlaunchファイルから起動するノードのプロセスが、子プロセス群に相当します。\r\n\r\nまず、Runtime ManagerからノードプロセスにSIGINTが送出され、\r\n次に、Runtime ManagerからroslaunchプロセスにSIGINTが送出されます。\r\nそして、roslaunchプロセスから、自分が起動したノードのプロセスに、SIGINTが送出されます。\r\nその結果、ノードのプロセスには2回SIGINTが送出されていました。\r\n\r\n\r\nコマンドの子プロセス群を終了させる処理を追加した経緯\r\n\r\nrosbag play, rosbag recordコマンド対応のため、処理を追加しておりました。\r\n上記rosbagコマンドの終了処理では、rosbagコマンドから起動される子プロセスに対しても、SIGTERM(あるいはSIGINT)を送出する必要がありました。\r\n\r\nrosbagコマンドを起動した端末から、^Cキー入力して終了させる場合では問題ないのですが、例えば別端末からkillコマンドでrosbagコマンドのプロセスにSIGINTを送出する場合では、子プロセスが動作し続けます。\r\n\r\n\r\n対策\r\n\r\n終了時に子プロセス群にSIGINTを送出する処理を削除した場合、\r\nrosbagコマンドの他、いつくかのコマンドで従来と動作が異なりました。\r\n\r\n子プロセス群にSIGINTを送出する処理は、オプション扱いとして残し、\r\n.yamlファイルで指定した場合に、実行するよう変更しました。\r\n\r\ngui :\r\n  flags : [ kill_children ]\r\nのフラグ指定がある場合のみ、子プロセス群にもSIGINTを送出します。\r\n\r\n単に子プロセス群にSIGINTを送出する処理を削除した場合では、\r\n次のコマンドで終了時に固まり画面が暗くなる現象が出ました。\r\n\r\n- Quick Startタブ\r\n  Sensingボタン (おそらく内部でVelodyne系ドライバを起動してるため)\r\n\r\n- Sensingタブ\r\n  Javad Delta 3 (rosrunコマンドで.shファイルを起動し.shからroslaunchコマンドを起動してる)\r\n  Velodyne系のドライバ\r\n  Virtual Scan Imageボタン (Qt使用?)\r\n\r\n上記コマンドの.yamlファイルの対応箇所に、子プロセス群にSIGINTを送出する指定を追加し、従来通りの処理となってます。\r\n","created_at":"2016-08-02T02:58:31Z","updated_at":"2016-08-02T02:58:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1afacb19a51e391c68f727f50023d5c4c74d8018","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CPFL/Autoware/pulls/405/commits","review_comments_url":"https://api.github.com/repos/CPFL/Autoware/pulls/405/comments","review_comment_url":"https://api.github.com/repos/CPFL/Autoware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CPFL/Autoware/issues/405/comments","statuses_url":"https://api.github.com/repos/CPFL/Autoware/statuses/737eb809d376ed192bea7b7c211385665d60c591","head":{"label":"CPFL:fix_sigint_twice","ref":"fix_sigint_twice","sha":"737eb809d376ed192bea7b7c211385665d60c591","user":{"login":"CPFL","id":2747893,"avatar_url":"https://avatars.githubusercontent.com/u/2747893?v=3","gravatar_id":"","url":"https://api.github.com/users/CPFL","html_url":"https://github.com/CPFL","followers_url":"https://api.github.com/users/CPFL/followers","following_url":"https://api.github.com/users/CPFL/following{/other_user}","gists_url":"https://api.github.com/users/CPFL/gists{/gist_id}","starred_url":"https://api.github.com/users/CPFL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPFL/subscriptions","organizations_url":"https://api.github.com/users/CPFL/orgs","repos_url":"https://api.github.com/users/CPFL/repos","events_url":"https://api.github.com/users/CPFL/events{/privacy}","received_events_url":"https://api.github.com/users/CPFL/received_events","type":"Organization","site_admin":false},"repo":{"id":41331761,"name":"Autoware","full_name":"CPFL/Autoware","owner":{"login":"CPFL","id":2747893,"avatar_url":"https://avatars.githubusercontent.com/u/2747893?v=3","gravatar_id":"","url":"https://api.github.com/users/CPFL","html_url":"https://github.com/CPFL","followers_url":"https://api.github.com/users/CPFL/followers","following_url":"https://api.github.com/users/CPFL/following{/other_user}","gists_url":"https://api.github.com/users/CPFL/gists{/gist_id}","starred_url":"https://api.github.com/users/CPFL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPFL/subscriptions","organizations_url":"https://api.github.com/users/CPFL/orgs","repos_url":"https://api.github.com/users/CPFL/repos","events_url":"https://api.github.com/users/CPFL/events{/privacy}","received_events_url":"https://api.github.com/users/CPFL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CPFL/Autoware","description":"Open-source software for urban autonomous driving","fork":false,"url":"https://api.github.com/repos/CPFL/Autoware","forks_url":"https://api.github.com/repos/CPFL/Autoware/forks","keys_url":"https://api.github.com/repos/CPFL/Autoware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CPFL/Autoware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CPFL/Autoware/teams","hooks_url":"https://api.github.com/repos/CPFL/Autoware/hooks","issue_events_url":"https://api.github.com/repos/CPFL/Autoware/issues/events{/number}","events_url":"https://api.github.com/repos/CPFL/Autoware/events","assignees_url":"https://api.github.com/repos/CPFL/Autoware/assignees{/user}","branches_url":"https://api.github.com/repos/CPFL/Autoware/branches{/branch}","tags_url":"https://api.github.com/repos/CPFL/Autoware/tags","blobs_url":"https://api.github.com/repos/CPFL/Autoware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CPFL/Autoware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CPFL/Autoware/git/refs{/sha}","trees_url":"https://api.github.com/repos/CPFL/Autoware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CPFL/Autoware/statuses/{sha}","languages_url":"https://api.github.com/repos/CPFL/Autoware/languages","stargazers_url":"https://api.github.com/repos/CPFL/Autoware/stargazers","contributors_url":"https://api.github.com/repos/CPFL/Autoware/contributors","subscribers_url":"https://api.github.com/repos/CPFL/Autoware/subscribers","subscription_url":"https://api.github.com/repos/CPFL/Autoware/subscription","commits_url":"https://api.github.com/repos/CPFL/Autoware/commits{/sha}","git_commits_url":"https://api.github.com/repos/CPFL/Autoware/git/commits{/sha}","comments_url":"https://api.github.com/repos/CPFL/Autoware/comments{/number}","issue_comment_url":"https://api.github.com/repos/CPFL/Autoware/issues/comments{/number}","contents_url":"https://api.github.com/repos/CPFL/Autoware/contents/{+path}","compare_url":"https://api.github.com/repos/CPFL/Autoware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CPFL/Autoware/merges","archive_url":"https://api.github.com/repos/CPFL/Autoware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CPFL/Autoware/downloads","issues_url":"https://api.github.com/repos/CPFL/Autoware/issues{/number}","pulls_url":"https://api.github.com/repos/CPFL/Autoware/pulls{/number}","milestones_url":"https://api.github.com/repos/CPFL/Autoware/milestones{/number}","notifications_url":"https://api.github.com/repos/CPFL/Autoware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CPFL/Autoware/labels{/name}","releases_url":"https://api.github.com/repos/CPFL/Autoware/releases{/id}","deployments_url":"https://api.github.com/repos/CPFL/Autoware/deployments","created_at":"2015-08-24T23:17:57Z","updated_at":"2016-08-02T02:53:15Z","pushed_at":"2016-08-02T02:58:31Z","git_url":"git://github.com/CPFL/Autoware.git","ssh_url":"git@github.com:CPFL/Autoware.git","clone_url":"https://github.com/CPFL/Autoware.git","svn_url":"https://github.com/CPFL/Autoware","homepage":null,"size":248842,"stargazers_count":131,"watchers_count":131,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":24,"forks":62,"open_issues":24,"watchers":131,"default_branch":"master"}},"base":{"label":"CPFL:master","ref":"master","sha":"17feded12f5960c05a7afe17fff63bad3c8c9e91","user":{"login":"CPFL","id":2747893,"avatar_url":"https://avatars.githubusercontent.com/u/2747893?v=3","gravatar_id":"","url":"https://api.github.com/users/CPFL","html_url":"https://github.com/CPFL","followers_url":"https://api.github.com/users/CPFL/followers","following_url":"https://api.github.com/users/CPFL/following{/other_user}","gists_url":"https://api.github.com/users/CPFL/gists{/gist_id}","starred_url":"https://api.github.com/users/CPFL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPFL/subscriptions","organizations_url":"https://api.github.com/users/CPFL/orgs","repos_url":"https://api.github.com/users/CPFL/repos","events_url":"https://api.github.com/users/CPFL/events{/privacy}","received_events_url":"https://api.github.com/users/CPFL/received_events","type":"Organization","site_admin":false},"repo":{"id":41331761,"name":"Autoware","full_name":"CPFL/Autoware","owner":{"login":"CPFL","id":2747893,"avatar_url":"https://avatars.githubusercontent.com/u/2747893?v=3","gravatar_id":"","url":"https://api.github.com/users/CPFL","html_url":"https://github.com/CPFL","followers_url":"https://api.github.com/users/CPFL/followers","following_url":"https://api.github.com/users/CPFL/following{/other_user}","gists_url":"https://api.github.com/users/CPFL/gists{/gist_id}","starred_url":"https://api.github.com/users/CPFL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CPFL/subscriptions","organizations_url":"https://api.github.com/users/CPFL/orgs","repos_url":"https://api.github.com/users/CPFL/repos","events_url":"https://api.github.com/users/CPFL/events{/privacy}","received_events_url":"https://api.github.com/users/CPFL/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CPFL/Autoware","description":"Open-source software for urban autonomous driving","fork":false,"url":"https://api.github.com/repos/CPFL/Autoware","forks_url":"https://api.github.com/repos/CPFL/Autoware/forks","keys_url":"https://api.github.com/repos/CPFL/Autoware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CPFL/Autoware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CPFL/Autoware/teams","hooks_url":"https://api.github.com/repos/CPFL/Autoware/hooks","issue_events_url":"https://api.github.com/repos/CPFL/Autoware/issues/events{/number}","events_url":"https://api.github.com/repos/CPFL/Autoware/events","assignees_url":"https://api.github.com/repos/CPFL/Autoware/assignees{/user}","branches_url":"https://api.github.com/repos/CPFL/Autoware/branches{/branch}","tags_url":"https://api.github.com/repos/CPFL/Autoware/tags","blobs_url":"https://api.github.com/repos/CPFL/Autoware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CPFL/Autoware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CPFL/Autoware/git/refs{/sha}","trees_url":"https://api.github.com/repos/CPFL/Autoware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CPFL/Autoware/statuses/{sha}","languages_url":"https://api.github.com/repos/CPFL/Autoware/languages","stargazers_url":"https://api.github.com/repos/CPFL/Autoware/stargazers","contributors_url":"https://api.github.com/repos/CPFL/Autoware/contributors","subscribers_url":"https://api.github.com/repos/CPFL/Autoware/subscribers","subscription_url":"https://api.github.com/repos/CPFL/Autoware/subscription","commits_url":"https://api.github.com/repos/CPFL/Autoware/commits{/sha}","git_commits_url":"https://api.github.com/repos/CPFL/Autoware/git/commits{/sha}","comments_url":"https://api.github.com/repos/CPFL/Autoware/comments{/number}","issue_comment_url":"https://api.github.com/repos/CPFL/Autoware/issues/comments{/number}","contents_url":"https://api.github.com/repos/CPFL/Autoware/contents/{+path}","compare_url":"https://api.github.com/repos/CPFL/Autoware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CPFL/Autoware/merges","archive_url":"https://api.github.com/repos/CPFL/Autoware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CPFL/Autoware/downloads","issues_url":"https://api.github.com/repos/CPFL/Autoware/issues{/number}","pulls_url":"https://api.github.com/repos/CPFL/Autoware/pulls{/number}","milestones_url":"https://api.github.com/repos/CPFL/Autoware/milestones{/number}","notifications_url":"https://api.github.com/repos/CPFL/Autoware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CPFL/Autoware/labels{/name}","releases_url":"https://api.github.com/repos/CPFL/Autoware/releases{/id}","deployments_url":"https://api.github.com/repos/CPFL/Autoware/deployments","created_at":"2015-08-24T23:17:57Z","updated_at":"2016-08-02T02:53:15Z","pushed_at":"2016-08-02T02:58:31Z","git_url":"git://github.com/CPFL/Autoware.git","ssh_url":"git@github.com:CPFL/Autoware.git","clone_url":"https://github.com/CPFL/Autoware.git","svn_url":"https://github.com/CPFL/Autoware","homepage":null,"size":248842,"stargazers_count":131,"watchers_count":131,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":24,"forks":62,"open_issues":24,"watchers":131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CPFL/Autoware/pulls/405"},"html":{"href":"https://github.com/CPFL/Autoware/pull/405"},"issue":{"href":"https://api.github.com/repos/CPFL/Autoware/issues/405"},"comments":{"href":"https://api.github.com/repos/CPFL/Autoware/issues/405/comments"},"review_comments":{"href":"https://api.github.com/repos/CPFL/Autoware/pulls/405/comments"},"review_comment":{"href":"https://api.github.com/repos/CPFL/Autoware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CPFL/Autoware/pulls/405/commits"},"statuses":{"href":"https://api.github.com/repos/CPFL/Autoware/statuses/737eb809d376ed192bea7b7c211385665d60c591"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":17,"deletions":10,"changed_files":4}}
{"actor":{"display_login":"kondoh2"}}