{"action":"created","comment":{"url":"https://api.github.com/repos/lxc/lxd/pulls/comments/168893847","pull_request_review_id":97344839,"id":168893847,"diff_hunk":"@@ -43,36 +43,60 @@ func (e *Endpoints) NetworkUpdateAddress(address string) error {\n \t\taddress = util.CanonicalNetworkAddress(address)\n \t}\n \n-\tif address == e.NetworkAddress() {\n+\toldAddress := e.NetworkAddress()\n+\tif address == oldAddress {\n \t\treturn nil\n \t}\n \n \tlogger.Infof(\"Update network address\")\n \n-\t// First try to see if we can listen to this new port at all, so we\n-\t// don't close the old one (if any) in case of errors.\n-\tvar listener net.Listener\n-\tif address != \"\" {\n+\te.mu.Lock()\n+\tdefer e.mu.Unlock()","path":"lxd/endpoints/network.go","position":17,"original_position":17,"commit_id":"b0bbe25d99c72860464e25dd8accd54847a0ee1f","original_commit_id":"b0bbe25d99c72860464e25dd8accd54847a0ee1f","user":{"login":"brauner","id":7353573,"avatar_url":"https://avatars0.githubusercontent.com/u/7353573?v=4","gravatar_id":"","url":"https://api.github.com/users/brauner","html_url":"https://github.com/brauner","followers_url":"https://api.github.com/users/brauner/followers","following_url":"https://api.github.com/users/brauner/following{/other_user}","gists_url":"https://api.github.com/users/brauner/gists{/gist_id}","starred_url":"https://api.github.com/users/brauner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauner/subscriptions","organizations_url":"https://api.github.com/users/brauner/orgs","repos_url":"https://api.github.com/users/brauner/repos","events_url":"https://api.github.com/users/brauner/events{/privacy}","received_events_url":"https://api.github.com/users/brauner/received_events","type":"User","site_admin":false},"body":"Holding a lock for a whole second. :)","created_at":"2018-02-16T23:15:09Z","updated_at":"2018-02-16T23:15:10Z","html_url":"https://github.com/lxc/lxd/pull/4259#discussion_r168893847","pull_request_url":"https://api.github.com/repos/lxc/lxd/pulls/4259","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments/168893847"},"html":{"href":"https://github.com/lxc/lxd/pull/4259#discussion_r168893847"},"pull_request":{"href":"https://api.github.com/repos/lxc/lxd/pulls/4259"}}},"pull_request":{"url":"https://api.github.com/repos/lxc/lxd/pulls/4259","id":169745114,"html_url":"https://github.com/lxc/lxd/pull/4259","diff_url":"https://github.com/lxc/lxd/pull/4259.diff","patch_url":"https://github.com/lxc/lxd/pull/4259.patch","issue_url":"https://api.github.com/repos/lxc/lxd/issues/4259","number":4259,"state":"open","locked":false,"title":"lxd: Rework listening logic","user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars0.githubusercontent.com/u/2230599?v=4","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"body":"Closes #4256\r\n\r\nSigned-off-by: Stéphane Graber <stgraber@ubuntu.com>","created_at":"2018-02-16T22:55:17Z","updated_at":"2018-02-16T23:15:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8aab0a36df2c321561bdc0e8417e1b35ab8c34e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/lxc/lxd/pulls/4259/commits","review_comments_url":"https://api.github.com/repos/lxc/lxd/pulls/4259/comments","review_comment_url":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/4259/comments","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/b0bbe25d99c72860464e25dd8accd54847a0ee1f","head":{"label":"stgraber:master","ref":"master","sha":"b0bbe25d99c72860464e25dd8accd54847a0ee1f","user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars0.githubusercontent.com/u/2230599?v=4","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"repo":{"id":26225592,"name":"lxd","full_name":"stgraber/lxd","owner":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars0.githubusercontent.com/u/2230599?v=4","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stgraber/lxd","description":"Personal work copy of lxc/lxd","fork":true,"url":"https://api.github.com/repos/stgraber/lxd","forks_url":"https://api.github.com/repos/stgraber/lxd/forks","keys_url":"https://api.github.com/repos/stgraber/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stgraber/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stgraber/lxd/teams","hooks_url":"https://api.github.com/repos/stgraber/lxd/hooks","issue_events_url":"https://api.github.com/repos/stgraber/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/stgraber/lxd/events","assignees_url":"https://api.github.com/repos/stgraber/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/stgraber/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/stgraber/lxd/tags","blobs_url":"https://api.github.com/repos/stgraber/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stgraber/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stgraber/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/stgraber/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stgraber/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/stgraber/lxd/languages","stargazers_url":"https://api.github.com/repos/stgraber/lxd/stargazers","contributors_url":"https://api.github.com/repos/stgraber/lxd/contributors","subscribers_url":"https://api.github.com/repos/stgraber/lxd/subscribers","subscription_url":"https://api.github.com/repos/stgraber/lxd/subscription","commits_url":"https://api.github.com/repos/stgraber/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/stgraber/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/stgraber/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/stgraber/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/stgraber/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/stgraber/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stgraber/lxd/merges","archive_url":"https://api.github.com/repos/stgraber/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stgraber/lxd/downloads","issues_url":"https://api.github.com/repos/stgraber/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/stgraber/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/stgraber/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/stgraber/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stgraber/lxd/labels{/name}","releases_url":"https://api.github.com/repos/stgraber/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/stgraber/lxd/deployments","created_at":"2014-11-05T15:24:41Z","updated_at":"2016-10-24T19:21:09Z","pushed_at":"2018-02-16T22:55:10Z","git_url":"git://github.com/stgraber/lxd.git","ssh_url":"git@github.com:stgraber/lxd.git","clone_url":"https://github.com/stgraber/lxd.git","svn_url":"https://github.com/stgraber/lxd","homepage":"","size":14602,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"lxc:master","ref":"master","sha":"0e30a4480b3403432afe0de3daa89d0695fba01d","user":{"login":"lxc","id":2301756,"avatar_url":"https://avatars2.githubusercontent.com/u/2301756?v=4","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"repo":{"id":26192117,"name":"lxd","full_name":"lxc/lxd","owner":{"login":"lxc","id":2301756,"avatar_url":"https://avatars2.githubusercontent.com/u/2301756?v=4","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lxc/lxd","description":"Daemon based on liblxc offering a REST API to manage containers","fork":false,"url":"https://api.github.com/repos/lxc/lxd","forks_url":"https://api.github.com/repos/lxc/lxd/forks","keys_url":"https://api.github.com/repos/lxc/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lxc/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lxc/lxd/teams","hooks_url":"https://api.github.com/repos/lxc/lxd/hooks","issue_events_url":"https://api.github.com/repos/lxc/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/lxc/lxd/events","assignees_url":"https://api.github.com/repos/lxc/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/lxc/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/lxc/lxd/tags","blobs_url":"https://api.github.com/repos/lxc/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lxc/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lxc/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lxc/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/lxc/lxd/languages","stargazers_url":"https://api.github.com/repos/lxc/lxd/stargazers","contributors_url":"https://api.github.com/repos/lxc/lxd/contributors","subscribers_url":"https://api.github.com/repos/lxc/lxd/subscribers","subscription_url":"https://api.github.com/repos/lxc/lxd/subscription","commits_url":"https://api.github.com/repos/lxc/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lxc/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lxc/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lxc/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lxc/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/lxc/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lxc/lxd/merges","archive_url":"https://api.github.com/repos/lxc/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lxc/lxd/downloads","issues_url":"https://api.github.com/repos/lxc/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/lxc/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/lxc/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/lxc/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lxc/lxd/labels{/name}","releases_url":"https://api.github.com/repos/lxc/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/lxc/lxd/deployments","created_at":"2014-11-04T22:40:52Z","updated_at":"2018-02-16T17:02:43Z","pushed_at":"2018-02-16T22:55:18Z","git_url":"git://github.com/lxc/lxd.git","ssh_url":"git@github.com:lxc/lxd.git","clone_url":"https://github.com/lxc/lxd.git","svn_url":"https://github.com/lxc/lxd","homepage":"https://linuxcontainers.org/lxd","size":17211,"stargazers_count":1657,"watchers_count":1657,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":402,"mirror_url":null,"archived":false,"open_issues_count":51,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":402,"open_issues":51,"watchers":1657,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/4259"},"html":{"href":"https://github.com/lxc/lxd/pull/4259"},"issue":{"href":"https://api.github.com/repos/lxc/lxd/issues/4259"},"comments":{"href":"https://api.github.com/repos/lxc/lxd/issues/4259/comments"},"review_comments":{"href":"https://api.github.com/repos/lxc/lxd/pulls/4259/comments"},"review_comment":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lxc/lxd/pulls/4259/commits"},"statuses":{"href":"https://api.github.com/repos/lxc/lxd/statuses/b0bbe25d99c72860464e25dd8accd54847a0ee1f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"brauner"}}