{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/141426529","pull_request_review_id":65606987,"id":141426529,"diff_hunk":"@@ -0,0 +1,24 @@\n+summary: Each snap process is moved to appropriate freezer cgroup\n+details: |\n+    This test creates a snap process that suspends itself and ensures that it\n+    placed into the appropriate hierarchy under the freezer cgroup.\n+prepare: |\n+    . $TESTSLIB/snaps.sh\n+    install_local test-snapd-sh\n+execute: |\n+    test-snapd-sh -c 'sleep 1000' &\n+    pid=$!","path":"tests/main/cgroup-freezer/task.yaml","position":10,"original_position":10,"commit_id":"8b12bbf5fa528e11862d046ba6b525ac95bf3dcd","original_commit_id":"8b12bbf5fa528e11862d046ba6b525ac95bf3dcd","user":{"login":"jhenstridge","id":12724165,"avatar_url":"https://avatars2.githubusercontent.com/u/12724165?v=4","gravatar_id":"","url":"https://api.github.com/users/jhenstridge","html_url":"https://github.com/jhenstridge","followers_url":"https://api.github.com/users/jhenstridge/followers","following_url":"https://api.github.com/users/jhenstridge/following{/other_user}","gists_url":"https://api.github.com/users/jhenstridge/gists{/gist_id}","starred_url":"https://api.github.com/users/jhenstridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhenstridge/subscriptions","organizations_url":"https://api.github.com/users/jhenstridge/orgs","repos_url":"https://api.github.com/users/jhenstridge/repos","events_url":"https://api.github.com/users/jhenstridge/events{/privacy}","received_events_url":"https://api.github.com/users/jhenstridge/received_events","type":"User","site_admin":false},"body":"Maybe it would be worth starting two instances of the command in the test? That would give coverage for adding a process to an existing cgroup.","created_at":"2017-09-27T18:18:11Z","updated_at":"2017-09-27T18:23:10Z","html_url":"https://github.com/snapcore/snapd/pull/3973#discussion_r141426529","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/3973","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/141426529"},"html":{"href":"https://github.com/snapcore/snapd/pull/3973#discussion_r141426529"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/3973"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/3973","id":143424526,"html_url":"https://github.com/snapcore/snapd/pull/3973","diff_url":"https://github.com/snapcore/snapd/pull/3973.diff","patch_url":"https://github.com/snapcore/snapd/pull/3973.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/3973","number":3973,"state":"open","locked":false,"title":"cmd/snap-confine: put processes into freezer hierarchy","user":{"login":"zyga","id":784262,"avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"body":"This patch makes snap-confine move each started snap process into a\r\nfreezer cgroup hierarchy called \"snap.$SNAP_NAME\". This allows for\r\nreliable enumeration of all processes belonging to a given snap.\r\n\r\nReliable enumeration will be required by the upcoming base snap\r\ninvalidation feature, where preserved mount namespaces that are not\r\nusing the current revision of the base snap *and* have no processes, can\r\nbe and are discarded.\r\n\r\nWe cannot rely on the per-snap flock(2)-lock file since existing\r\nprocesses do not need to acquire that lock to fork. While a simple\r\nflock-based approach can reliably block new apps/hook processes from\r\nstarting it cannot stop processes from freely forking or exiting without\r\na race condition. A malicious (or just unlucky) process could repeatedly\r\nfork and exit and could isolate itself from changes to the snap mount\r\nnamespace.\r\n\r\nSubsequent patches will build upon this feature to detect when a mount\r\nnamespace is stale and vacant and can be discarded and re-built.\r\n\r\nSigned-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>","created_at":"2017-09-27T15:25:47Z","updated_at":"2017-09-27T18:23:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1aa751695a8d08999c0c216a0e2a52bdac98963a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/3973/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/3973/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/3973/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/8b12bbf5fa528e11862d046ba6b525ac95bf3dcd","head":{"label":"zyga:feature/use-freezer-cgroup","ref":"feature/use-freezer-cgroup","sha":"8b12bbf5fa528e11862d046ba6b525ac95bf3dcd","user":{"login":"zyga","id":784262,"avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"repo":{"id":45263078,"name":"snapd","full_name":"zyga/snapd","owner":{"login":"zyga","id":784262,"avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zyga/snapd","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/zyga/snapd","forks_url":"https://api.github.com/repos/zyga/snapd/forks","keys_url":"https://api.github.com/repos/zyga/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zyga/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zyga/snapd/teams","hooks_url":"https://api.github.com/repos/zyga/snapd/hooks","issue_events_url":"https://api.github.com/repos/zyga/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/zyga/snapd/events","assignees_url":"https://api.github.com/repos/zyga/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/zyga/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/zyga/snapd/tags","blobs_url":"https://api.github.com/repos/zyga/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zyga/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zyga/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/zyga/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zyga/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/zyga/snapd/languages","stargazers_url":"https://api.github.com/repos/zyga/snapd/stargazers","contributors_url":"https://api.github.com/repos/zyga/snapd/contributors","subscribers_url":"https://api.github.com/repos/zyga/snapd/subscribers","subscription_url":"https://api.github.com/repos/zyga/snapd/subscription","commits_url":"https://api.github.com/repos/zyga/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/zyga/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/zyga/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/zyga/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/zyga/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/zyga/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zyga/snapd/merges","archive_url":"https://api.github.com/repos/zyga/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zyga/snapd/downloads","issues_url":"https://api.github.com/repos/zyga/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/zyga/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/zyga/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/zyga/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zyga/snapd/labels{/name}","releases_url":"https://api.github.com/repos/zyga/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/zyga/snapd/deployments","created_at":"2015-10-30T16:30:25Z","updated_at":"2017-09-12T17:37:13Z","pushed_at":"2017-09-27T16:21:12Z","git_url":"git://github.com/zyga/snapd.git","ssh_url":"git@github.com:zyga/snapd.git","clone_url":"https://github.com/zyga/snapd.git","svn_url":"https://github.com/zyga/snapd","homepage":null,"size":53467,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"snapcore:master","ref":"master","sha":"1d7d79cc9c8b687bb242a66a08c8309a6799950a","user":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2017-09-26T14:30:27Z","pushed_at":"2017-09-27T17:47:23Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":53441,"stargazers_count":794,"watchers_count":794,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":26,"forks":202,"open_issues":26,"watchers":794,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/3973"},"html":{"href":"https://github.com/snapcore/snapd/pull/3973"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/3973"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/3973/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/3973/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/3973/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/8b12bbf5fa528e11862d046ba6b525ac95bf3dcd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jhenstridge"}}