{"action":"created","comment":{"url":"https://api.github.com/repos/mitchellh/packer/pulls/comments/33802849","id":33802849,"diff_hunk":"@@ -273,9 +281,45 @@ func (c *comm) reconnect() (err error) {\n \t}\n \n \tlog.Printf(\"handshaking with SSH\")\n-\tsshConn, sshChan, req, err := ssh.NewClientConn(c.conn, c.address, c.config.SSHConfig)\n+\n+\t// Default timeout to 1 minute if it wasn't specified (zero value). For\n+\t// when you need to handshake from low orbit.\n+\tvar duration time.Duration\n+\tif c.config.HandshakeTimeout == 0 {\n+\t\tduration = 1 * time.Minute\n+\t} else {\n+\t\tduration = c.config.HandshakeTimeout\n+\t}\n+\n+\ttimeoutExceeded := time.After(duration)\n+\tconnectionEstablished := make(chan bool, 1)","path":"communicator/ssh/communicator.go","position":53,"original_position":53,"commit_id":"5dd8ae45c70876dc478af0eee856ff9ac4845f5b","original_commit_id":"5dd8ae45c70876dc478af0eee856ff9ac4845f5b","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"body":"If you don't use a value for a channel, and you're only using it to signal, it is more idiomatic to use a `chan struct{}`. It takes up less memory space, but also just signals that the value is useless. ","created_at":"2015-07-02T17:40:00Z","updated_at":"2015-07-02T17:40:00Z","html_url":"https://github.com/mitchellh/packer/pull/2379#discussion_r33802849","pull_request_url":"https://api.github.com/repos/mitchellh/packer/pulls/2379","_links":{"self":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/comments/33802849"},"html":{"href":"https://github.com/mitchellh/packer/pull/2379#discussion_r33802849"},"pull_request":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/2379"}}},"pull_request":{"url":"https://api.github.com/repos/mitchellh/packer/pulls/2379","id":39069558,"html_url":"https://github.com/mitchellh/packer/pull/2379","diff_url":"https://github.com/mitchellh/packer/pull/2379.diff","patch_url":"https://github.com/mitchellh/packer/pull/2379.patch","issue_url":"https://api.github.com/repos/mitchellh/packer/issues/2379","number":2379,"state":"open","locked":false,"title":"Wrap SSH handshake in a timeout","user":{"login":"cbednarski","id":649798,"avatar_url":"https://avatars.githubusercontent.com/u/649798?v=3","gravatar_id":"","url":"https://api.github.com/users/cbednarski","html_url":"https://github.com/cbednarski","followers_url":"https://api.github.com/users/cbednarski/followers","following_url":"https://api.github.com/users/cbednarski/following{/other_user}","gists_url":"https://api.github.com/users/cbednarski/gists{/gist_id}","starred_url":"https://api.github.com/users/cbednarski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbednarski/subscriptions","organizations_url":"https://api.github.com/users/cbednarski/orgs","repos_url":"https://api.github.com/users/cbednarski/repos","events_url":"https://api.github.com/users/cbednarski/events{/privacy}","received_events_url":"https://api.github.com/users/cbednarski/received_events","type":"User","site_admin":false},"body":"Fixes #2333\n\nI think this may still need some resource cleanup (connection close and such) but I want to make sure the approach is right.","created_at":"2015-07-02T10:42:59Z","updated_at":"2015-07-02T17:40:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2490c020715b29a9e155cefa6d3f368b873ef5ad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mitchellh/packer/pulls/2379/commits","review_comments_url":"https://api.github.com/repos/mitchellh/packer/pulls/2379/comments","review_comment_url":"https://api.github.com/repos/mitchellh/packer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/2379/comments","statuses_url":"https://api.github.com/repos/mitchellh/packer/statuses/5dd8ae45c70876dc478af0eee856ff9ac4845f5b","head":{"label":"mitchellh:b-ssh-handhake-timeout","ref":"b-ssh-handhake-timeout","sha":"5dd8ae45c70876dc478af0eee856ff9ac4845f5b","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"repo":{"id":8966356,"name":"packer","full_name":"mitchellh/packer","owner":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitchellh/packer","description":"Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.","fork":false,"url":"https://api.github.com/repos/mitchellh/packer","forks_url":"https://api.github.com/repos/mitchellh/packer/forks","keys_url":"https://api.github.com/repos/mitchellh/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitchellh/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitchellh/packer/teams","hooks_url":"https://api.github.com/repos/mitchellh/packer/hooks","issue_events_url":"https://api.github.com/repos/mitchellh/packer/issues/events{/number}","events_url":"https://api.github.com/repos/mitchellh/packer/events","assignees_url":"https://api.github.com/repos/mitchellh/packer/assignees{/user}","branches_url":"https://api.github.com/repos/mitchellh/packer/branches{/branch}","tags_url":"https://api.github.com/repos/mitchellh/packer/tags","blobs_url":"https://api.github.com/repos/mitchellh/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitchellh/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitchellh/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitchellh/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitchellh/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/mitchellh/packer/languages","stargazers_url":"https://api.github.com/repos/mitchellh/packer/stargazers","contributors_url":"https://api.github.com/repos/mitchellh/packer/contributors","subscribers_url":"https://api.github.com/repos/mitchellh/packer/subscribers","subscription_url":"https://api.github.com/repos/mitchellh/packer/subscription","commits_url":"https://api.github.com/repos/mitchellh/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitchellh/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitchellh/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitchellh/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitchellh/packer/contents/{+path}","compare_url":"https://api.github.com/repos/mitchellh/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitchellh/packer/merges","archive_url":"https://api.github.com/repos/mitchellh/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitchellh/packer/downloads","issues_url":"https://api.github.com/repos/mitchellh/packer/issues{/number}","pulls_url":"https://api.github.com/repos/mitchellh/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/mitchellh/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/mitchellh/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitchellh/packer/labels{/name}","releases_url":"https://api.github.com/repos/mitchellh/packer/releases{/id}","created_at":"2013-03-23T05:43:03Z","updated_at":"2015-07-02T15:17:05Z","pushed_at":"2015-07-02T14:36:29Z","git_url":"git://github.com/mitchellh/packer.git","ssh_url":"git@github.com:mitchellh/packer.git","clone_url":"https://github.com/mitchellh/packer.git","svn_url":"https://github.com/mitchellh/packer","homepage":"http://www.packer.io","size":24008,"stargazers_count":4209,"watchers_count":4209,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":855,"mirror_url":null,"open_issues_count":124,"forks":855,"open_issues":124,"watchers":4209,"default_branch":"master"}},"base":{"label":"mitchellh:master","ref":"master","sha":"6ca48fa3c81998bea1d3b6d31343f509697f351c","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"repo":{"id":8966356,"name":"packer","full_name":"mitchellh/packer","owner":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitchellh/packer","description":"Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.","fork":false,"url":"https://api.github.com/repos/mitchellh/packer","forks_url":"https://api.github.com/repos/mitchellh/packer/forks","keys_url":"https://api.github.com/repos/mitchellh/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitchellh/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitchellh/packer/teams","hooks_url":"https://api.github.com/repos/mitchellh/packer/hooks","issue_events_url":"https://api.github.com/repos/mitchellh/packer/issues/events{/number}","events_url":"https://api.github.com/repos/mitchellh/packer/events","assignees_url":"https://api.github.com/repos/mitchellh/packer/assignees{/user}","branches_url":"https://api.github.com/repos/mitchellh/packer/branches{/branch}","tags_url":"https://api.github.com/repos/mitchellh/packer/tags","blobs_url":"https://api.github.com/repos/mitchellh/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitchellh/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitchellh/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitchellh/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitchellh/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/mitchellh/packer/languages","stargazers_url":"https://api.github.com/repos/mitchellh/packer/stargazers","contributors_url":"https://api.github.com/repos/mitchellh/packer/contributors","subscribers_url":"https://api.github.com/repos/mitchellh/packer/subscribers","subscription_url":"https://api.github.com/repos/mitchellh/packer/subscription","commits_url":"https://api.github.com/repos/mitchellh/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitchellh/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitchellh/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitchellh/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitchellh/packer/contents/{+path}","compare_url":"https://api.github.com/repos/mitchellh/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitchellh/packer/merges","archive_url":"https://api.github.com/repos/mitchellh/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitchellh/packer/downloads","issues_url":"https://api.github.com/repos/mitchellh/packer/issues{/number}","pulls_url":"https://api.github.com/repos/mitchellh/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/mitchellh/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/mitchellh/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitchellh/packer/labels{/name}","releases_url":"https://api.github.com/repos/mitchellh/packer/releases{/id}","created_at":"2013-03-23T05:43:03Z","updated_at":"2015-07-02T15:17:05Z","pushed_at":"2015-07-02T14:36:29Z","git_url":"git://github.com/mitchellh/packer.git","ssh_url":"git@github.com:mitchellh/packer.git","clone_url":"https://github.com/mitchellh/packer.git","svn_url":"https://github.com/mitchellh/packer","homepage":"http://www.packer.io","size":24008,"stargazers_count":4209,"watchers_count":4209,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":855,"mirror_url":null,"open_issues_count":124,"forks":855,"open_issues":124,"watchers":4209,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/2379"},"html":{"href":"https://github.com/mitchellh/packer/pull/2379"},"issue":{"href":"https://api.github.com/repos/mitchellh/packer/issues/2379"},"comments":{"href":"https://api.github.com/repos/mitchellh/packer/issues/2379/comments"},"review_comments":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/2379/comments"},"review_comment":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitchellh/packer/pulls/2379/commits"},"statuses":{"href":"https://api.github.com/repos/mitchellh/packer/statuses/5dd8ae45c70876dc478af0eee856ff9ac4845f5b"}}}}