{"action":"created","issue":{"url":"https://api.github.com/repos/streadway/amqp/issues/200","repository_url":"https://api.github.com/repos/streadway/amqp","labels_url":"https://api.github.com/repos/streadway/amqp/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/streadway/amqp/issues/200/comments","events_url":"https://api.github.com/repos/streadway/amqp/issues/200/events","html_url":"https://github.com/streadway/amqp/pull/200","id":151560019,"number":200,"title":"Fix data race when closing amqp connection","user":{"login":"mouadino","id":1884531,"avatar_url":"https://avatars.githubusercontent.com/u/1884531?v=3","gravatar_id":"","url":"https://api.github.com/users/mouadino","html_url":"https://github.com/mouadino","followers_url":"https://api.github.com/users/mouadino/followers","following_url":"https://api.github.com/users/mouadino/following{/other_user}","gists_url":"https://api.github.com/users/mouadino/gists{/gist_id}","starred_url":"https://api.github.com/users/mouadino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mouadino/subscriptions","organizations_url":"https://api.github.com/users/mouadino/orgs","repos_url":"https://api.github.com/users/mouadino/repos","events_url":"https://api.github.com/users/mouadino/events{/privacy}","received_events_url":"https://api.github.com/users/mouadino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-28T06:31:23Z","updated_at":"2016-04-28T17:09:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/streadway/amqp/pulls/200","html_url":"https://github.com/streadway/amqp/pull/200","diff_url":"https://github.com/streadway/amqp/pull/200.diff","patch_url":"https://github.com/streadway/amqp/pull/200.patch"},"body":"When using conn.NotifyClose, this later append to a list of channels\r\n``me.closes``, while conn.shutdown() range over this list, so when a\r\nconnection is closed, ``conn.NotifyClose()`` may detect the connection closing\r\nin the same time as the ``conn.shutdown()`` call, this is done in two\r\ngoroutine, which end up in data race where one appending to me.closes\r\nand the other looping over it.\r\n\r\nThe fix is to move setting ``noNotify`` to True to the top of\r\n``conn.shutdown()``, this way ``conn.NotifyClose()`` will not append to the\r\nlist anymore."},"comment":{"url":"https://api.github.com/repos/streadway/amqp/issues/comments/215497501","html_url":"https://github.com/streadway/amqp/pull/200#issuecomment-215497501","issue_url":"https://api.github.com/repos/streadway/amqp/issues/200","id":215497501,"user":{"login":"imkira","id":470338,"avatar_url":"https://avatars.githubusercontent.com/u/470338?v=3","gravatar_id":"","url":"https://api.github.com/users/imkira","html_url":"https://github.com/imkira","followers_url":"https://api.github.com/users/imkira/followers","following_url":"https://api.github.com/users/imkira/following{/other_user}","gists_url":"https://api.github.com/users/imkira/gists{/gist_id}","starred_url":"https://api.github.com/users/imkira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imkira/subscriptions","organizations_url":"https://api.github.com/users/imkira/orgs","repos_url":"https://api.github.com/users/imkira/repos","events_url":"https://api.github.com/users/imkira/events{/privacy}","received_events_url":"https://api.github.com/users/imkira/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T17:09:57Z","updated_at":"2016-04-28T17:09:57Z","body":"@mouadino how different would be that be from #196 ?\r\nI wonder if that passes the tests I wrote too."}}