{"action":"opened","issue":{"url":"https://api.github.com/repos/zettajs/zetta/issues/236","labels_url":"https://api.github.com/repos/zettajs/zetta/issues/236/labels{/name}","comments_url":"https://api.github.com/repos/zettajs/zetta/issues/236/comments","events_url":"https://api.github.com/repos/zettajs/zetta/issues/236/events","html_url":"https://github.com/zettajs/zetta/issues/236","id":107718423,"number":236,"title":"Peer management multiple PUT request doesn't disconnect properly.","user":{"login":"AdamMagaluk","id":823985,"avatar_url":"https://avatars.githubusercontent.com/u/823985?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamMagaluk","html_url":"https://github.com/AdamMagaluk","followers_url":"https://api.github.com/users/AdamMagaluk/followers","following_url":"https://api.github.com/users/AdamMagaluk/following{/other_user}","gists_url":"https://api.github.com/users/AdamMagaluk/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamMagaluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamMagaluk/subscriptions","organizations_url":"https://api.github.com/users/AdamMagaluk/orgs","repos_url":"https://api.github.com/users/AdamMagaluk/repos","events_url":"https://api.github.com/users/AdamMagaluk/events{/privacy}","received_events_url":"https://api.github.com/users/AdamMagaluk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-22T13:47:12Z","updated_at":"2015-09-22T13:47:12Z","closed_at":null,"body":"Notice there seems to be a weird case if you perform multiple PUT request on a peer with a `url` to the original cloud server it creates multiple connections after first request.\r\n\r\nExample: Hub1 -> Cloud\r\n\r\n`curl -X PUT --data url='http://cloud' http://cloud/peer-management/<connection_id_1>`\r\n\r\nAt this point hub1 will disconnect from cloud and reconnect back to cloud.\r\n\r\nTo force a second disconnect:\r\n\r\n`curl -X PUT --data url='http://cloud' http://cloud/peer-management/<connection_id_2>`\r\n\r\nAfter this request the hub goes into a loop trying to connect to the cloud but receives a 409 conflict because it's already peered."}}