{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/10747","repository_url":"https://api.github.com/repos/openshift/origin","labels_url":"https://api.github.com/repos/openshift/origin/issues/10747/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/10747/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/10747/events","html_url":"https://github.com/openshift/origin/pull/10747","id":174363902,"number":10747,"title":"Make the router data structures remove duplicates cleanly","user":{"login":"knobunc","id":10033853,"avatar_url":"https://avatars.githubusercontent.com/u/10033853?v=3","gravatar_id":"","url":"https://api.github.com/users/knobunc","html_url":"https://github.com/knobunc","followers_url":"https://api.github.com/users/knobunc/followers","following_url":"https://api.github.com/users/knobunc/following{/other_user}","gists_url":"https://api.github.com/users/knobunc/gists{/gist_id}","starred_url":"https://api.github.com/users/knobunc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knobunc/subscriptions","organizations_url":"https://api.github.com/users/knobunc/orgs","repos_url":"https://api.github.com/users/knobunc/repos","events_url":"https://api.github.com/users/knobunc/events{/privacy}","received_events_url":"https://api.github.com/users/knobunc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-08-31T19:57:25Z","updated_at":"2016-09-08T13:33:38Z","closed_at":"2016-09-01T23:10:35Z","pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/10747","html_url":"https://github.com/openshift/origin/pull/10747","diff_url":"https://github.com/openshift/origin/pull/10747.diff","patch_url":"https://github.com/openshift/origin/pull/10747.patch"},"body":"The bug is caused by the modification of the route.  In the code it\r\nwould add a new object to the list of routes by the host and not\r\nremove them.  When the route was deleted, it would remove all of the\r\nroutes with the same name, and then the list would be cleared.\r\nUnfortunately, the code would then look at the number of items in the\r\nlist, and either delete it from the map, or clean items out of the\r\nlist.  But since it was possible for there to be multiple duplicate\r\nnames, we could end up with an empty list.  Later code would assume\r\nthat if there was a key in the map, then the associated list would\r\nhave items.  That caused a panic.\r\n\r\nThis fix changes both places:\r\n- If there are duplicates, remove them all, and then if the list is\r\n  empty, delete the key from the map\r\n- When a modification happens, remove the previous entry from the list\r\n\r\nSo, the first duplicate check is now just for protection, but the\r\nproper fix is to clean out the lists before adding items to them.\r\n\r\nFixes bug 1371826"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/245598408","html_url":"https://github.com/openshift/origin/pull/10747#issuecomment-245598408","issue_url":"https://api.github.com/repos/openshift/origin/issues/10747","id":245598408,"user":{"login":"knobunc","id":10033853,"avatar_url":"https://avatars.githubusercontent.com/u/10033853?v=3","gravatar_id":"","url":"https://api.github.com/users/knobunc","html_url":"https://github.com/knobunc","followers_url":"https://api.github.com/users/knobunc/followers","following_url":"https://api.github.com/users/knobunc/following{/other_user}","gists_url":"https://api.github.com/users/knobunc/gists{/gist_id}","starred_url":"https://api.github.com/users/knobunc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knobunc/subscriptions","organizations_url":"https://api.github.com/users/knobunc/orgs","repos_url":"https://api.github.com/users/knobunc/repos","events_url":"https://api.github.com/users/knobunc/events{/privacy}","received_events_url":"https://api.github.com/users/knobunc/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T13:33:38Z","updated_at":"2016-09-08T13:33:38Z","body":"After talking to @spinolacastro over IRC.  This seems like a new (but similar) issue, so a new bug will be opened."}}
{"actor":{"display_login":"knobunc"}}