{"action":"created","comment":{"url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/comments/49670135","id":49670135,"diff_hunk":"@@ -289,6 +332,42 @@ function createDockerFileReadStreamServer(opts, callback) {\n \n         zlogin.stdout.pipe(socket);\n     }\n+\n+    function onConnectionZoneNotRunning(socket) {\n+        clearTimeout(serverTimeout);\n+\n+        socket.on('close', function () {\n+            tcpServer.close();\n+        });\n+\n+        if (norm.match(new RegExp('^/'))) {\n+            norm = norm.slice(1);\n+        }\n+\n+        var chrootTarCmd = __dirname + '/../bin/chroot-gtar';\n+        var chrootTarArgs = [\n+            '-r', zonepath,\n+            '-t', '-',\n+            '-m', 'create',\n+            '-C', 'root',\n+            norm];\n+\n+        var spawnargs = [chrootTarCmd, chrootTarArgs, { encoding: 'binary' }];\n+\n+        log.info('docker copy tar spawn args');\n+        log.info(JSON.stringify(spawnargs));\n+\n+        var streamProc = spawn.apply(null, spawnargs);","path":"lib/docker-stdio.js","position":176,"original_position":176,"commit_id":"f55152176e75c989dd0081785e235509d654b06a","original_commit_id":"f55152176e75c989dd0081785e235509d654b06a","user":{"login":"notmatt","id":92480,"avatar_url":"https://avatars.githubusercontent.com/u/92480?v=3","gravatar_id":"","url":"https://api.github.com/users/notmatt","html_url":"https://github.com/notmatt","followers_url":"https://api.github.com/users/notmatt/followers","following_url":"https://api.github.com/users/notmatt/following{/other_user}","gists_url":"https://api.github.com/users/notmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/notmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notmatt/subscriptions","organizations_url":"https://api.github.com/users/notmatt/orgs","repos_url":"https://api.github.com/users/notmatt/repos","events_url":"https://api.github.com/users/notmatt/events{/privacy}","received_events_url":"https://api.github.com/users/notmatt/received_events","type":"User","site_admin":false},"body":"Nit: appears like the only reason to use `apply()` is to simplify the logging, I'd prefer complicated-looking logging with explicit params over the indirection of `apply()`.","created_at":"2016-01-13T23:55:11Z","updated_at":"2016-01-13T23:55:11Z","html_url":"https://github.com/joyent/sdc-cn-agent/pull/9#discussion_r49670135","pull_request_url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/comments/49670135"},"html":{"href":"https://github.com/joyent/sdc-cn-agent/pull/9#discussion_r49670135"},"pull_request":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9","id":55940468,"html_url":"https://github.com/joyent/sdc-cn-agent/pull/9","diff_url":"https://github.com/joyent/sdc-cn-agent/pull/9.diff","patch_url":"https://github.com/joyent/sdc-cn-agent/pull/9.patch","issue_url":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/9","number":9,"state":"open","locked":false,"title":"DOCKER-633: implement docker copy for stopped containers","user":{"login":"orlandov","id":16321,"avatar_url":"https://avatars.githubusercontent.com/u/16321?v=3","gravatar_id":"","url":"https://api.github.com/users/orlandov","html_url":"https://github.com/orlandov","followers_url":"https://api.github.com/users/orlandov/followers","following_url":"https://api.github.com/users/orlandov/following{/other_user}","gists_url":"https://api.github.com/users/orlandov/gists{/gist_id}","starred_url":"https://api.github.com/users/orlandov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orlandov/subscriptions","organizations_url":"https://api.github.com/users/orlandov/orgs","repos_url":"https://api.github.com/users/orlandov/repos","events_url":"https://api.github.com/users/orlandov/events{/privacy}","received_events_url":"https://api.github.com/users/orlandov/received_events","type":"User","site_admin":false},"body":"Use the recently added `chroot-gtar` script to create and extract tar (gtar) streams from a stopped container.","created_at":"2016-01-13T19:03:48Z","updated_at":"2016-01-13T23:55:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fb02b35a37e2d29dd9d0fff0f2a4bb135ab7cd3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9/commits","review_comments_url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9/comments","review_comment_url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/9/comments","statuses_url":"https://api.github.com/repos/joyent/sdc-cn-agent/statuses/f55152176e75c989dd0081785e235509d654b06a","head":{"label":"orlandov:master","ref":"master","sha":"f55152176e75c989dd0081785e235509d654b06a","user":{"login":"orlandov","id":16321,"avatar_url":"https://avatars.githubusercontent.com/u/16321?v=3","gravatar_id":"","url":"https://api.github.com/users/orlandov","html_url":"https://github.com/orlandov","followers_url":"https://api.github.com/users/orlandov/followers","following_url":"https://api.github.com/users/orlandov/following{/other_user}","gists_url":"https://api.github.com/users/orlandov/gists{/gist_id}","starred_url":"https://api.github.com/users/orlandov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orlandov/subscriptions","organizations_url":"https://api.github.com/users/orlandov/orgs","repos_url":"https://api.github.com/users/orlandov/repos","events_url":"https://api.github.com/users/orlandov/events{/privacy}","received_events_url":"https://api.github.com/users/orlandov/received_events","type":"User","site_admin":false},"repo":{"id":49593109,"name":"sdc-cn-agent","full_name":"orlandov/sdc-cn-agent","owner":{"login":"orlandov","id":16321,"avatar_url":"https://avatars.githubusercontent.com/u/16321?v=3","gravatar_id":"","url":"https://api.github.com/users/orlandov","html_url":"https://github.com/orlandov","followers_url":"https://api.github.com/users/orlandov/followers","following_url":"https://api.github.com/users/orlandov/following{/other_user}","gists_url":"https://api.github.com/users/orlandov/gists{/gist_id}","starred_url":"https://api.github.com/users/orlandov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orlandov/subscriptions","organizations_url":"https://api.github.com/users/orlandov/orgs","repos_url":"https://api.github.com/users/orlandov/repos","events_url":"https://api.github.com/users/orlandov/events{/privacy}","received_events_url":"https://api.github.com/users/orlandov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/orlandov/sdc-cn-agent","description":"SDC Compute Node agent; monitors and reports cn-usage, executes tasks","fork":true,"url":"https://api.github.com/repos/orlandov/sdc-cn-agent","forks_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/forks","keys_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/teams","hooks_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/hooks","issue_events_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/issues/events{/number}","events_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/events","assignees_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/assignees{/user}","branches_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/branches{/branch}","tags_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/tags","blobs_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/languages","stargazers_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/stargazers","contributors_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/contributors","subscribers_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/subscribers","subscription_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/subscription","commits_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/contents/{+path}","compare_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/merges","archive_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/downloads","issues_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/issues{/number}","pulls_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/labels{/name}","releases_url":"https://api.github.com/repos/orlandov/sdc-cn-agent/releases{/id}","created_at":"2016-01-13T18:26:26Z","updated_at":"2016-01-13T18:26:27Z","pushed_at":"2016-01-13T18:59:37Z","git_url":"git://github.com/orlandov/sdc-cn-agent.git","ssh_url":"git@github.com:orlandov/sdc-cn-agent.git","clone_url":"https://github.com/orlandov/sdc-cn-agent.git","svn_url":"https://github.com/orlandov/sdc-cn-agent","homepage":null,"size":977,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"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":0,"default_branch":"master"}},"base":{"label":"joyent:master","ref":"master","sha":"9fae9b98b07edbb708e6368b92037148882638f5","user":{"login":"joyent","id":10161,"avatar_url":"https://avatars.githubusercontent.com/u/10161?v=3","gravatar_id":"","url":"https://api.github.com/users/joyent","html_url":"https://github.com/joyent","followers_url":"https://api.github.com/users/joyent/followers","following_url":"https://api.github.com/users/joyent/following{/other_user}","gists_url":"https://api.github.com/users/joyent/gists{/gist_id}","starred_url":"https://api.github.com/users/joyent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joyent/subscriptions","organizations_url":"https://api.github.com/users/joyent/orgs","repos_url":"https://api.github.com/users/joyent/repos","events_url":"https://api.github.com/users/joyent/events{/privacy}","received_events_url":"https://api.github.com/users/joyent/received_events","type":"Organization","site_admin":false},"repo":{"id":23447711,"name":"sdc-cn-agent","full_name":"joyent/sdc-cn-agent","owner":{"login":"joyent","id":10161,"avatar_url":"https://avatars.githubusercontent.com/u/10161?v=3","gravatar_id":"","url":"https://api.github.com/users/joyent","html_url":"https://github.com/joyent","followers_url":"https://api.github.com/users/joyent/followers","following_url":"https://api.github.com/users/joyent/following{/other_user}","gists_url":"https://api.github.com/users/joyent/gists{/gist_id}","starred_url":"https://api.github.com/users/joyent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joyent/subscriptions","organizations_url":"https://api.github.com/users/joyent/orgs","repos_url":"https://api.github.com/users/joyent/repos","events_url":"https://api.github.com/users/joyent/events{/privacy}","received_events_url":"https://api.github.com/users/joyent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joyent/sdc-cn-agent","description":"SDC Compute Node agent; monitors and reports cn-usage, executes tasks","fork":false,"url":"https://api.github.com/repos/joyent/sdc-cn-agent","forks_url":"https://api.github.com/repos/joyent/sdc-cn-agent/forks","keys_url":"https://api.github.com/repos/joyent/sdc-cn-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joyent/sdc-cn-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joyent/sdc-cn-agent/teams","hooks_url":"https://api.github.com/repos/joyent/sdc-cn-agent/hooks","issue_events_url":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/events{/number}","events_url":"https://api.github.com/repos/joyent/sdc-cn-agent/events","assignees_url":"https://api.github.com/repos/joyent/sdc-cn-agent/assignees{/user}","branches_url":"https://api.github.com/repos/joyent/sdc-cn-agent/branches{/branch}","tags_url":"https://api.github.com/repos/joyent/sdc-cn-agent/tags","blobs_url":"https://api.github.com/repos/joyent/sdc-cn-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joyent/sdc-cn-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joyent/sdc-cn-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/joyent/sdc-cn-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joyent/sdc-cn-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/joyent/sdc-cn-agent/languages","stargazers_url":"https://api.github.com/repos/joyent/sdc-cn-agent/stargazers","contributors_url":"https://api.github.com/repos/joyent/sdc-cn-agent/contributors","subscribers_url":"https://api.github.com/repos/joyent/sdc-cn-agent/subscribers","subscription_url":"https://api.github.com/repos/joyent/sdc-cn-agent/subscription","commits_url":"https://api.github.com/repos/joyent/sdc-cn-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/joyent/sdc-cn-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/joyent/sdc-cn-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/joyent/sdc-cn-agent/contents/{+path}","compare_url":"https://api.github.com/repos/joyent/sdc-cn-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joyent/sdc-cn-agent/merges","archive_url":"https://api.github.com/repos/joyent/sdc-cn-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joyent/sdc-cn-agent/downloads","issues_url":"https://api.github.com/repos/joyent/sdc-cn-agent/issues{/number}","pulls_url":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/joyent/sdc-cn-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/joyent/sdc-cn-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joyent/sdc-cn-agent/labels{/name}","releases_url":"https://api.github.com/repos/joyent/sdc-cn-agent/releases{/id}","created_at":"2014-08-29T00:43:35Z","updated_at":"2015-05-07T21:49:31Z","pushed_at":"2016-01-13T19:03:48Z","git_url":"git://github.com/joyent/sdc-cn-agent.git","ssh_url":"git@github.com:joyent/sdc-cn-agent.git","clone_url":"https://github.com/joyent/sdc-cn-agent.git","svn_url":"https://github.com/joyent/sdc-cn-agent","homepage":null,"size":981,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9"},"html":{"href":"https://github.com/joyent/sdc-cn-agent/pull/9"},"issue":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/9"},"comments":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/joyent/sdc-cn-agent/statuses/f55152176e75c989dd0081785e235509d654b06a"}}}}