)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da6ed579_b369df8d","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":10},"updated":"2016-01-12 18:23:48.000000000","message":"Suggest s/agents/agents\u0027","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da6ed579_5756d35c","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":10},"in_reply_to":"da6ed579_624cce42","updated":"2016-01-14 14:02:44.000000000","message":"Done","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades support"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"da6ed579_624cce42","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":10},"in_reply_to":"da6ed579_b369df8d","updated":"2016-01-13 06:53:39.000000000","message":"Thanks, will fix.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d64566884d4eadc97449657ccc67f4f9b97de1a5","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da6ed579_5ac22f54","line":15,"updated":"2016-01-15 16:30:10.000000000","message":"known","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da6ed579_5c98aa6a","line":15,"in_reply_to":"da6ed579_5ac22f54","updated":"2016-01-18 09:52:05.000000000","message":"right, thanks.","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d64566884d4eadc97449657ccc67f4f9b97de1a5","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I3fb49ae6fe237a926225b508bc8f0286426bf532"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da6ed579_9a7ae722","line":19,"updated":"2016-01-15 16:30:10.000000000","message":"wanna link to some bug?","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I3fb49ae6fe237a926225b508bc8f0286426bf532"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"da6ed579_ff5e3011","line":19,"in_reply_to":"da6ed579_9a7ae722","updated":"2016-01-18 09:52:05.000000000","message":"Right, I\u0027ve just filled: https://bugs.launchpad.net/neutron/+bug/1535247","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades logic"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_31c5125b","line":10,"range":{"start_line":10,"start_character":18,"end_line":10,"end_character":24},"updated":"2016-01-18 20:38:34.000000000","message":"Suggest: \"object-type\"","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"a57926c6a3b15a3ea69b79ac3d60871680229080","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades logic"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_48efb4b0","line":10,"range":{"start_line":10,"start_character":18,"end_line":10,"end_character":24},"in_reply_to":"ba63e191_31c5125b","updated":"2016-01-18 20:42:05.000000000","message":"And actually I think I should have suggested, here and below, \"resource\" rather than \"object\".","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":7,"context_line":"RPC Callback rolling upgrades logic"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_b0ba5e6d","line":10,"range":{"start_line":10,"start_character":18,"end_line":10,"end_character":24},"in_reply_to":"ba63e191_48efb4b0","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da6ed579_1d5a1e2b","line":11,"updated":"2016-01-18 16:23:52.000000000","message":"not generally notifications, but rpc callback push notifications.\n\n\u0027extra\u0027 to what? If you mean \u0027to the latest known version\u0027, then I don\u0027t think we should always send the latest version if there are no agents to listen to it, should we?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_10aa4a1a","line":11,"in_reply_to":"ba63e191_bfff5d00","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_bb2a3f2b","line":11,"in_reply_to":"ba63e191_bfff5d00","updated":"2016-01-20 13:17:52.000000000","message":"OK. I think we would still be better if we don\u0027t have a hack and get notification from oslo messaging library, but before that is implemented, I think it\u0027s fine to go with your approach, just make sure we have a TODO in the code.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"a589c47d0e3d660fa7f8b33e77beb90fbeaa1426","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_bfff5d00","line":11,"in_reply_to":"da6ed579_1d5a1e2b","updated":"2016-01-19 13:03:49.000000000","message":"I assume any agent will eventually need our latest versions (as they upgrade), I thought of a possible scenario we\u0027re not covering, and I wanted to cover it (it\u0027s in the end better to send useless notification, than not sending needed ones).\n\nThink of this scenario:\n\n  1) one or several neutron-servers get disconnected from rpc (while running)\n  2) a new agent comes up, with the latest version set after upgrade, and it reports 2 ways:\n     a) via status report (which will be stored in the database)\n     b) via fanout call (https://review.openstack.org/#/c/268040/2/neutron/plugins/ml2/plugin.py) to all neutron servers, this way, all of them get their version set updated right away without the need to re-fetch anything from the database.\n  3) the neutron-servers get back online to the rpc bus, buy they lost the fanout.\n\n\n\nIn that scenario, the ideal thing would be to detect the RPC reconnection, and to invalidate the cache, so the version set needs to be recalculated from the agent database.\n\nI\u0027m not sure oslo_messaging allows such thing for the rpc end consumers, I will investigate that.\n\nProviding the \"latest\" version set always, means, that the upgrade path is covered.\n\nAnd we\u0027d only miss the downgrade path, if all agents are updated already, a neutron-server is off RPC, and a downgraded agent comes up.\n\nIs it worth the effort supporting this last failure scenario and downgrade case by making the mechanism more complicated? (probably we could find good reasons, and probably that\u0027d be a good reason for a third patch in the series: ideally, we can add a callback to notify reconnection from oslo_messaging).","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_5c7c5d20","line":12,"range":{"start_line":11,"start_character":0,"end_line":12,"end_character":38},"updated":"2016-01-18 20:38:34.000000000","message":"Suggest something like (incorporating Ihar\u0027s suggestion): \"...making RPC callback pushes smart about the collection of object-type versions the agents know about and therefore which objects to serialize and send over the wire as a result of a resource update such as a change made to a particular QoS policy instance.\"\n\nI apologize if I\u0027ve misunderstood the mechanism at play here.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_d0035275","line":12,"range":{"start_line":11,"start_character":0,"end_line":12,"end_character":38},"in_reply_to":"ba63e191_08177ca4","updated":"2016-01-25 14:47:34.000000000","message":"Done (with my own wording, I hope it\u0027s clearer now, otherwise we can keep working on it)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"a57926c6a3b15a3ea69b79ac3d60871680229080","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Introduces a version manager in the callbacks rpc, which tracks"},{"line_number":10,"context_line":"the agents\u0027 known object versions across the distributed system,"},{"line_number":11,"context_line":"making notifications smart about which extra versions to serialize"},{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_08177ca4","line":12,"range":{"start_line":11,"start_character":0,"end_line":12,"end_character":38},"in_reply_to":"ba63e191_5c7c5d20","updated":"2016-01-18 20:42:05.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da6ed579_8a726c48","line":15,"range":{"start_line":15,"start_character":0,"end_line":15,"end_character":4},"updated":"2016-01-18 20:38:34.000000000","message":"Suggest: \"... agents\u0027 known object versions (as opposed to object-type versions), the status ...\"","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da6ed579_5dd3b65f","line":15,"updated":"2016-01-18 16:23:52.000000000","message":"known, versions -\u003e object versions","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_304bceb2","line":15,"in_reply_to":"ba63e191_3d3db22b","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":12,"context_line":"and send over the wire during updates."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":15,"context_line":"know versions, the status updates with versions included, and"},{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ba63e191_3d3db22b","line":15,"in_reply_to":"da6ed579_5dd3b65f","updated":"2016-01-19 14:50:59.000000000","message":"I\u0027ll try to talk around about resource versions consistently.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I3fb49ae6fe237a926225b508bc8f0286426bf532"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"da6ed579_5d6176a7","line":19,"updated":"2016-01-18 16:23:52.000000000","message":"bug number needed","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":16,"context_line":"the fast path agent to neutron-servers fanout call with version"},{"line_number":17,"context_line":"details as defined in I02b694137eb2d58e5f2f3e7631f0e4b90f7c17ad"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I3fb49ae6fe237a926225b508bc8f0286426bf532"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9a68dd71_f0c0d6e2","line":19,"in_reply_to":"da6ed579_5d6176a7","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"3f94530f2e7cac1257f7e1f5ca9c14fa1d607e19","unresolved":false,"context_lines":[{"line_number":10,"context_line":"the agents\u0027 known resource versions across the distributed system,"},{"line_number":11,"context_line":"making rpc callback push notifications smart about which resource"},{"line_number":12,"context_line":"versions need to be serialized and sent over the wire during a"},{"line_number":13,"context_line":"cloud upgrade process."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":16,"context_line":"resource versions from database, the status updates with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a68dd71_5d75522f","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":21},"updated":"2016-01-25 18:34:52.000000000","message":"Your wording is much better than my suggestion.  Thank you!","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"80e4d0b9630deeb133639d0598690ecdf3fcfdaf","unresolved":false,"context_lines":[{"line_number":10,"context_line":"the agents\u0027 known resource versions across the distributed system,"},{"line_number":11,"context_line":"making rpc callback push notifications smart about which resource"},{"line_number":12,"context_line":"versions need to be serialized and sent over the wire during a"},{"line_number":13,"context_line":"cloud upgrade process."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Subsequent patches will implement the callback to fetch agent"},{"line_number":16,"context_line":"resource versions from database, the status updates with"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"9a68dd71_5f30c6e8","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":21},"in_reply_to":"9a68dd71_5d75522f","updated":"2016-01-26 11:22:32.000000000","message":"Thanks for checking it Margaret :-), and for the previous suggestions.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"}],"neutron/api/rpc/callbacks/exceptions.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e59a1906244b42cb8142a614e00f593f9d297a86","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class VersionsCallbackNotFound(exceptions.NeutronException):"},{"line_number":30,"context_line":"    message \u003d _(\"No callback provided in ResourceVersionsManager\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class VersionsCallbackWrongResult(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_d71fbe59","line":30,"updated":"2016-01-12 08:09:19.000000000","message":"it is better to include \u0027version\u0027 in the exception message.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4da4e6ffcda22e27473cf0bb86e5e042a293638a","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class VersionsCallbackNotFound(exceptions.NeutronException):"},{"line_number":30,"context_line":"    message \u003d _(\"No callback provided in ResourceVersionsManager\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class VersionsCallbackWrongResult(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_5a03dd73","line":30,"in_reply_to":"da6ed579_6ffcea3e","updated":"2016-01-12 18:01:00.000000000","message":"Done","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8040c397d3466fd37be0b216a4cd0ab7ce7aaaab","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class VersionsCallbackNotFound(exceptions.NeutronException):"},{"line_number":30,"context_line":"    message \u003d _(\"No callback provided in ResourceVersionsManager\")"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class VersionsCallbackWrongResult(exceptions.NeutronException):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_6ffcea3e","line":30,"in_reply_to":"da6ed579_d71fbe59","updated":"2016-01-12 11:56:52.000000000","message":"Ack, I will add it.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"}],"neutron/api/rpc/callbacks/resources.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e59a1906244b42cb8142a614e00f593f9d297a86","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return _TYPE_TO_CLS_MAP.get(resource_type)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def get_resource_versions(_type_to_cls_map\u003d_TYPE_TO_CLS_MAP):"},{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_97af06e3","line":54,"range":{"start_line":54,"start_character":26,"end_line":54,"end_character":59},"updated":"2016-01-12 08:09:19.000000000","message":"_type_to_cls_map\u003dNone\n\nit is not recommended to use an iterable object (a list or dict) as a default. It is because if a method changes the object the default value will be changed.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4da4e6ffcda22e27473cf0bb86e5e042a293638a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return _TYPE_TO_CLS_MAP.get(resource_type)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def get_resource_versions(_type_to_cls_map\u003d_TYPE_TO_CLS_MAP):"},{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_ae489a5c","line":54,"range":{"start_line":54,"start_character":26,"end_line":54,"end_character":59},"in_reply_to":"da6ed579_0f2bee31","updated":"2016-01-12 18:01:00.000000000","message":"Done","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8040c397d3466fd37be0b216a4cd0ab7ce7aaaab","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return _TYPE_TO_CLS_MAP.get(resource_type)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def get_resource_versions(_type_to_cls_map\u003d_TYPE_TO_CLS_MAP):"},{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_0f2bee31","line":54,"range":{"start_line":54,"start_character":26,"end_line":54,"end_character":59},"in_reply_to":"da6ed579_97af06e3","updated":"2016-01-12 11:56:52.000000000","message":"Yes, I know, I wanted to try a different way to make the function more testable, and it\u0027s not supposed to be used by the caller (except for testing).\n\nMay be it\u0027s better if I move it out from parameters and I just mock _TYPE_TO_CLS_MAP during tests.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d64566884d4eadc97449657ccc67f4f9b97de1a5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"},{"line_number":58,"context_line":"       format to avoid later unnecessary conversions."},{"line_number":59,"context_line":"    \"\"\""},{"line_number":60,"context_line":"    versions \u003d collections.defaultdict(set)"},{"line_number":61,"context_line":"    for resource_type, resource_class in _TYPE_TO_CLS_MAP.items():"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_3a489bcb","line":58,"updated":"2016-01-15 16:30:10.000000000","message":"I don\u0027t think tiny optimizations like that are an excuse for more complex api.","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"},{"line_number":58,"context_line":"       format to avoid later unnecessary conversions."},{"line_number":59,"context_line":"    \"\"\""},{"line_number":60,"context_line":"    versions \u003d collections.defaultdict(set)"},{"line_number":61,"context_line":"    for resource_type, resource_class in _TYPE_TO_CLS_MAP.items():"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_082c2daa","line":58,"in_reply_to":"da6ed579_3a489bcb","updated":"2016-01-18 09:52:05.000000000","message":"I\u0027m trying to optimize LOCs not speed, since lists and sets fit the purpose of most of the callers, why adding intermediate code to convert back and forth?.\n\nIt\u0027s just a convention over the return type.\n\nBut we could change it, I had mixed feelings about it, just didn\u0027t want to add conversion code anywhere, and I\u0027m not sure how\u0027re they going to play with serialization (agent-\u003eservers reporting)","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return _TYPE_TO_CLS_MAP.get(resource_type)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def local_resource_versions():"},{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_fd6cea09","line":54,"updated":"2016-01-18 16:23:52.000000000","message":"What\u0027s the point of recalculating the map every time we recalculate versions? I think it should be calculated once, in the global scope in the module (somewhere around line 34).","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return _TYPE_TO_CLS_MAP.get(resource_type)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def local_resource_versions():"},{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_bd652246","line":54,"in_reply_to":"da6ed579_fd6cea09","updated":"2016-01-19 14:50:59.000000000","message":"Good point!, I\u0027ll do it that way.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"},{"line_number":58,"context_line":"       format to avoid later unnecessary conversions."},{"line_number":59,"context_line":"    \"\"\""},{"line_number":60,"context_line":"    versions \u003d collections.defaultdict(set)"},{"line_number":61,"context_line":"    for resource_type, resource_class in _TYPE_TO_CLS_MAP.items():"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_1de0def9","line":58,"updated":"2016-01-18 16:23:52.000000000","message":"It\u0027s not worth making API more complex just for LOC optimization. From API POV, it\u0027s not ideal to return an iterable for a single value, it gives wrong perception that it may contain multiple versions.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    \"\"\"Returns a dictionary with a set of local versions per resource type."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"       The set will always contain only a single version. We return this"},{"line_number":58,"context_line":"       format to avoid later unnecessary conversions."},{"line_number":59,"context_line":"    \"\"\""},{"line_number":60,"context_line":"    versions \u003d collections.defaultdict(set)"},{"line_number":61,"context_line":"    for resource_type, resource_class in _TYPE_TO_CLS_MAP.items():"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_1ddc6ee3","line":58,"in_reply_to":"da6ed579_1de0def9","updated":"2016-01-19 14:50:59.000000000","message":"Ok, good point about the perception.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"}],"neutron/api/rpc/callbacks/version_manager.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b9816e36901afce3c507a29964fc2865ba9280ce","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import collections"},{"line_number":14,"context_line":"import time "},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from oslo_log import log as logging"},{"line_number":17,"context_line":"import six"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_ffe03c98","line":14,"updated":"2016-01-08 16:56:34.000000000","message":"trailing space! :(","commit_id":"9600ca43fe7b50a22cc995504d559db63898e4a3"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e59a1906244b42cb8142a614e00f593f9d297a86","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ConsumerVersions(object):"},{"line_number":27,"context_line":"    def __init__(self):"},{"line_number":28,"context_line":"        self._versions \u003d resources.get_resource_versions()"},{"line_number":29,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":30,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_faebc7ae","line":28,"updated":"2016-01-12 08:09:19.000000000","message":"It is a local version. It would be nice if we have more clear name like self._local_versions","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8040c397d3466fd37be0b216a4cd0ab7ce7aaaab","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"class ConsumerVersions(object):"},{"line_number":27,"context_line":"    def __init__(self):"},{"line_number":28,"context_line":"        self._versions \u003d resources.get_resource_versions()"},{"line_number":29,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":30,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":31,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_6fc4ea3f","line":28,"in_reply_to":"da6ed579_faebc7ae","updated":"2016-01-12 11:56:52.000000000","message":"It\u0027s initialised with the local versions (of the server source code), but then it\u0027s updated as add_versions is called.\n\nSo it\u0027s more like the calculated collection of versions, local_versions would not be correct I think.\n\nFrom your suggestion, may be we can rename get_resource_versions() to local_resource_versions() to make it super clear.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e59a1906244b42cb8142a614e00f593f9d297a86","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def resource_versions(self, resource_type):"},{"line_number":41,"context_line":"        if self._needs_recalculation:"},{"line_number":42,"context_line":"            self._recalculate_versions()"},{"line_number":43,"context_line":"            self._needs_recalculation \u003d False"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        return self._versions[resource_type]"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_1a601b35","line":43,"updated":"2016-01-12 08:09:19.000000000","message":"Is there a racing condition where add_version is called during recalculate_versions()?","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8040c397d3466fd37be0b216a4cd0ab7ce7aaaab","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def resource_versions(self, resource_type):"},{"line_number":41,"context_line":"        if self._needs_recalculation:"},{"line_number":42,"context_line":"            self._recalculate_versions()"},{"line_number":43,"context_line":"            self._needs_recalculation \u003d False"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        return self._versions[resource_type]"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_8f9cbe6a","line":43,"in_reply_to":"da6ed579_1a601b35","updated":"2016-01-12 11:56:52.000000000","message":"It should not happen in green threads because we don\u0027t have any blocking call, with other types of threading it could certainly happen. (As we modify _versions_by_consumer while iterating over it).\n\n\nI will add a lock to make this code futureproof.","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4da4e6ffcda22e27473cf0bb86e5e042a293638a","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    def resource_versions(self, resource_type):"},{"line_number":41,"context_line":"        if self._needs_recalculation:"},{"line_number":42,"context_line":"            self._recalculate_versions()"},{"line_number":43,"context_line":"            self._needs_recalculation \u003d False"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        return self._versions[resource_type]"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_38b06cf4","line":43,"in_reply_to":"da6ed579_8f9cbe6a","updated":"2016-01-12 18:01:00.000000000","message":"Done","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":30,"context_line":"        # to send those. The _versions dictionary will be updated when"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_62570a03","line":27,"range":{"start_line":27,"start_character":6,"end_line":27,"end_character":22},"updated":"2016-01-12 18:23:48.000000000","message":"Can a docstring be added?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":30,"context_line":"        # to send those. The _versions dictionary will be updated when"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_5441f1a7","line":27,"range":{"start_line":27,"start_character":6,"end_line":27,"end_character":22},"in_reply_to":"da6ed579_0251520e","updated":"2016-01-14 14:02:44.000000000","message":"Done","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    def __init__(self):"},{"line_number":29,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":30,"context_line":"        # to send those. The _versions dictionary will be updated when"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_0251520e","line":27,"range":{"start_line":27,"start_character":6,"end_line":27,"end_character":22},"in_reply_to":"da6ed579_62570a03","updated":"2016-01-13 06:53:39.000000000","message":"Sure, will do :)","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":43,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":44,"context_line":"            # recalculate the main dictionary of versions based on the"},{"line_number":45,"context_line":"            # new _versions_by_consumer, but we defer it until we have all."},{"line_number":46,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def resource_versions(self, resource_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_dc633fb0","line":45,"range":{"start_line":45,"start_character":48,"end_line":45,"end_character":74},"updated":"2016-01-12 18:23:48.000000000","message":"Is this necessarily so?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":43,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":44,"context_line":"            # recalculate the main dictionary of versions based on the"},{"line_number":45,"context_line":"            # new _versions_by_consumer, but we defer it until we have all."},{"line_number":46,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def resource_versions(self, resource_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_013819ee","line":45,"range":{"start_line":45,"start_character":48,"end_line":45,"end_character":74},"in_reply_to":"da6ed579_4e5adf2b","updated":"2016-01-14 14:02:44.000000000","message":"Thanks for the suggestion, comments updated.\n\nAbout the follow up, see lines 124-127 of this file.\n\nThere\u0027s where we explicitly invoke the callback to check the database and get ConsumerVersions constructed, once that\u0027s fully finished, we finally call resource_versions .\n\nI believe it should be safe, but thanks for examining this carefully.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"d18df0e439d8d941c3f37f2b99fd00fee78b437d","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":43,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":44,"context_line":"            # recalculate the main dictionary of versions based on the"},{"line_number":45,"context_line":"            # new _versions_by_consumer, but we defer it until we have all."},{"line_number":46,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def resource_versions(self, resource_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_4e5adf2b","line":45,"range":{"start_line":45,"start_character":48,"end_line":45,"end_character":74},"in_reply_to":"da6ed579_623b6ed2","updated":"2016-01-14 00:18:16.000000000","message":"I think your CPU-saving implementation makes sense.  But I wonder if this phrase could made be a bit more explicit, with something like \"...defer the recalculation until every agent has (re-)set the version for all of its resource types.\"  (Assuming my understanding here is the correct one; or s/every/the if I\u0027ve got it wrong.)\n\nBut a follow-up question (which I have under either interpretation of the above): what\u0027s to prevent a call to resource_version from occurring mid-way through the series of add_versions calls?  That\u0027s not a challenge, really just a question because I don\u0027t see it (yet).  (And could/should the answer to this follow-up question be included in this code comment?)","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":43,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":44,"context_line":"            # recalculate the main dictionary of versions based on the"},{"line_number":45,"context_line":"            # new _versions_by_consumer, but we defer it until we have all."},{"line_number":46,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def resource_versions(self, resource_type):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_623b6ed2","line":45,"range":{"start_line":45,"start_character":48,"end_line":45,"end_character":74},"in_reply_to":"da6ed579_dc633fb0","updated":"2016-01-13 06:53:39.000000000","message":"Yes, it\u0027s necessary, because agents are supposed to be added in batches (one call to add_version per agent and resource type combination), \n\nThe recalculation should not happen until all add_versions have finished, and before anyone tries to retrieve the resource set.\n\nThere are other ways of implementing this (adding an additional method -error prone-, recalculating on every add -wasted cpu time and slow-), this was the one that seemed more reasonable, but I\u0027m open to other ideas :)","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":56,"context_line":"    def _recalculate_versions(self):"},{"line_number":57,"context_line":"        \"\"\"Get the base system versions, and expand with all known clients.\"\"\""},{"line_number":58,"context_line":"        versions \u003d resources.local_resource_versions()"},{"line_number":59,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":60,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_edfc4b40","line":57,"range":{"start_line":57,"start_character":11,"end_line":57,"end_character":74},"updated":"2016-01-12 18:23:48.000000000","message":"Suggest possible clarification: \"Re-fetch the local (server) versions and add to those results the versions of all known clients.\"","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":56,"context_line":"    def _recalculate_versions(self):"},{"line_number":57,"context_line":"        \"\"\"Get the base system versions, and expand with all known clients.\"\"\""},{"line_number":58,"context_line":"        versions \u003d resources.local_resource_versions()"},{"line_number":59,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":60,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_b4ccedbb","line":57,"range":{"start_line":57,"start_character":11,"end_line":57,"end_character":74},"in_reply_to":"da6ed579_e24d1e73","updated":"2016-01-14 14:02:44.000000000","message":"I have rephrased it to stay in the 80 cols limit, could you check if it\u0027s right?, I\u0027m unsure about the last part.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":56,"context_line":"    def _recalculate_versions(self):"},{"line_number":57,"context_line":"        \"\"\"Get the base system versions, and expand with all known clients.\"\"\""},{"line_number":58,"context_line":"        versions \u003d resources.local_resource_versions()"},{"line_number":59,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":60,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_e24d1e73","line":57,"range":{"start_line":57,"start_character":11,"end_line":57,"end_character":74},"in_reply_to":"da6ed579_edfc4b40","updated":"2016-01-13 06:53:39.000000000","message":"Thanks, will fix.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            self._update_consumer_versions()"},{"line_number":112,"context_line":"            self._expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def update_version(self, client_id, resource_type, resource_version):"},{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_42d9a6f2","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":22},"updated":"2016-01-12 18:23:48.000000000","message":"This method is an abstraction of ConsumerVersions.add_version.  Should both methods be called, for instance, specify_version?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            self._update_consumer_versions()"},{"line_number":112,"context_line":"            self._expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def update_version(self, client_id, resource_type, resource_version):"},{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_a241660d","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":22},"in_reply_to":"da6ed579_42d9a6f2","updated":"2016-01-13 06:53:39.000000000","message":"They have sightly different semantics, but it\u0027s true that add_version handles both cases (where update is lines 39-46).\n\nI\u0027d probably chose set_version for both. How does that sound?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"d18df0e439d8d941c3f37f2b99fd00fee78b437d","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            self._update_consumer_versions()"},{"line_number":112,"context_line":"            self._expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def update_version(self, client_id, resource_type, resource_version):"},{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_6eeb2314","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":22},"in_reply_to":"da6ed579_a241660d","updated":"2016-01-14 00:18:16.000000000","message":"I like your suggested name; it\u0027s certainly better than specify_version :) .  Another idea I just had is publish_version or something along those lines (avoids possible initial confusion with the notion of a collection).","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_e2fc5a40","line":118,"range":{"start_line":118,"start_character":8,"end_line":118,"end_character":14},"updated":"2016-01-12 18:23:48.000000000","message":"Or other consumers?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_54fa5176","line":118,"range":{"start_line":118,"start_character":8,"end_line":118,"end_character":14},"in_reply_to":"da6ed579_62de0e6f","updated":"2016-01-14 14:02:44.000000000","message":"Done","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        \"\"\"Fast-path update a client version for a resource type."},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_62de0e6f","line":118,"range":{"start_line":118,"start_character":8,"end_line":118,"end_character":14},"in_reply_to":"da6ed579_e2fc5a40","updated":"2016-01-13 06:53:39.000000000","message":"Right, consumers is more consistent.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        self.versions.add_version(client_id, resource_type, resource_version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_88cfbdaf","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":11},"updated":"2016-01-12 18:23:48.000000000","message":"Nit: can this be made into 2 sentences?","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        self.versions.add_version(client_id, resource_type, resource_version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_14f05990","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":11},"in_reply_to":"da6ed579_42e3ca33","updated":"2016-01-14 14:02:44.000000000","message":"Done","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":118,"context_line":"        agents which boot up and quickly want to update the versions cache,"},{"line_number":119,"context_line":"        may be used to catch updated, downgraded, or not-upgraded agents"},{"line_number":120,"context_line":"        booting up after some time in the upgrade process."},{"line_number":121,"context_line":"        \"\"\""},{"line_number":122,"context_line":"        self.versions.add_version(client_id, resource_type, resource_version)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_42e3ca33","line":119,"range":{"start_line":119,"start_character":8,"end_line":119,"end_character":11},"in_reply_to":"da6ed579_88cfbdaf","updated":"2016-01-13 06:53:39.000000000","message":"Ack, I will rephrase this a bit.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"91a10cf709bea4a9fbde82ef6b550adbbcb724ae","unresolved":false,"context_lines":[{"line_number":130,"context_line":"#TODO(mangelajo): revisit this, this is an indication that we just need a"},{"line_number":131,"context_line":"#                 module and not a singleton"},{"line_number":132,"context_line":"#"},{"line_number":133,"context_line":"#        Opinions please? :)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def set_consumer_versions_callback(callback):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_6d6dbb03","line":133,"range":{"start_line":133,"start_character":9,"end_line":133,"end_character":17},"updated":"2016-01-12 18:23:48.000000000","message":"Not sure if you wanted opinions now or upon revisit.  But I think that a singleton nicely handles the expiry mechanism.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"518540dd470bba5e58913866acf7bd9724dad87c","unresolved":false,"context_lines":[{"line_number":130,"context_line":"#TODO(mangelajo): revisit this, this is an indication that we just need a"},{"line_number":131,"context_line":"#                 module and not a singleton"},{"line_number":132,"context_line":"#"},{"line_number":133,"context_line":"#        Opinions please? :)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def set_consumer_versions_callback(callback):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_9432095d","line":133,"range":{"start_line":133,"start_character":9,"end_line":133,"end_character":17},"in_reply_to":"da6ed579_023b929d","updated":"2016-01-14 14:02:44.000000000","message":"Done","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"34e4de40fa050ab7e31d676c267166b333403358","unresolved":false,"context_lines":[{"line_number":130,"context_line":"#TODO(mangelajo): revisit this, this is an indication that we just need a"},{"line_number":131,"context_line":"#                 module and not a singleton"},{"line_number":132,"context_line":"#"},{"line_number":133,"context_line":"#        Opinions please? :)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"def set_consumer_versions_callback(callback):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da6ed579_023b929d","line":133,"range":{"start_line":133,"start_character":9,"end_line":133,"end_character":17},"in_reply_to":"da6ed579_6d6dbb03","updated":"2016-01-13 06:53:39.000000000","message":"Opinions now is great, I wanted to share my own thoughts about the code and \"revisit\" it in a patchset. \n\nThank you Margaret.","commit_id":"24953780aa319a4dc9d739d0ac7dc19cd5965c48"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d64566884d4eadc97449657ccc67f4f9b97de1a5","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_dad29fd0","line":46,"updated":"2016-01-15 16:30:10.000000000","message":"do you expect to yield anywhere here?..","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_fce39e31","line":46,"in_reply_to":"da6ed579_dad29fd0","updated":"2016-01-18 09:52:05.000000000","message":"I\u0027m addressing previous reviewer comments (check PS2).\nThat\u0027s just a Semaphore, which is cheap, and makes the piece of code future proof.\n\nIt\u0027s unlikely we will ever get out of greenthreads, but can we guarantee that will never happen?.","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_bc4e8694","line":46,"in_reply_to":"da6ed579_dad29fd0","updated":"2016-01-18 09:52:05.000000000","message":"I\u0027m addressing previous reviewer comments.","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"f9891007ca9c2457cbf500cfeec643c6722f37ac","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":50,"context_line":"        prev_version \u003d ("},{"line_number":51,"context_line":"            self._versions_by_consumer[consumer_id].get(resource_type, None))"},{"line_number":52,"context_line":"        self._versions_by_consumer[consumer_id][resource_type] \u003d version"},{"line_number":53,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":54,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":55,"context_line":"            # recalculate the main dictionary of versions based on the"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_b72ef489","line":52,"range":{"start_line":52,"start_character":65,"end_line":52,"end_character":72},"updated":"2016-01-15 12:25:55.000000000","message":"Could it be possible that version is an older version than prev_version? Should there be a check for this to avoid setting the value?","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":50,"context_line":"        prev_version \u003d ("},{"line_number":51,"context_line":"            self._versions_by_consumer[consumer_id].get(resource_type, None))"},{"line_number":52,"context_line":"        self._versions_by_consumer[consumer_id][resource_type] \u003d version"},{"line_number":53,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":54,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":55,"context_line":"            # recalculate the main dictionary of versions based on the"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_1c72327d","line":52,"range":{"start_line":52,"start_character":65,"end_line":52,"end_character":72},"in_reply_to":"da6ed579_b72ef489","updated":"2016-01-18 09:52:05.000000000","message":"We should cover that case if it does eventually happen, for example if an agent gets downgraded for some reason if a node upgrade needs to be rolled back, we can support it.\n\nI agree, it\u0027s not a common case, and at least we should be writing down an info log on it.","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"f9891007ca9c2457cbf500cfeec643c6722f37ac","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self._versions \u003d versions"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_5202260b","line":79,"range":{"start_line":79,"start_character":36,"end_line":79,"end_character":38},"updated":"2016-01-15 12:25:55.000000000","message":"Does the singleton instance of the class manage 1..m agents/consumers?","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self._versions \u003d versions"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_3c1db60f","line":79,"range":{"start_line":79,"start_character":36,"end_line":79,"end_character":38},"in_reply_to":"da6ed579_5202260b","updated":"2016-01-18 09:52:05.000000000","message":"It\u0027s supposed to calculate the version set for all of them, but that\u0027s left for the lower level ConsumerVersions class, which is actually a return type for the callback (L118)","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"f9891007ca9c2457cbf500cfeec643c6722f37ac","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if not cls._singleton:"},{"line_number":91,"context_line":"            return super(ResourceVersionsManager, cls).__new__(cls)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if not hasattr(cls, \u0027_instance\u0027):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_d798487a","line":90,"range":{"start_line":90,"start_character":29,"end_line":90,"end_character":30},"updated":"2016-01-15 12:25:55.000000000","message":"Could there potentially be a threading issue here?","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"512de4d6ef45d4c33019fa883625c8763ad93aaf","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if not cls._singleton:"},{"line_number":91,"context_line":"            return super(ResourceVersionsManager, cls).__new__(cls)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        if not hasattr(cls, \u0027_instance\u0027):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_9c870212","line":90,"range":{"start_line":90,"start_character":29,"end_line":90,"end_character":30},"in_reply_to":"da6ed579_d798487a","updated":"2016-01-18 09:52:05.000000000","message":"To be coherent I should probably stick to something, like what I\u0027m saying on L46.\n\nNot on the greenthread model we use, but it could happen with normal threading.\n\nI will either add a lock, or remove all. @amotoki, @iharchys, what do you think?","commit_id":"432a2204593b778166df66fb1f1532bfc4bd41fd"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_9fbfdea9","line":27,"updated":"2016-01-18 16:23:52.000000000","message":"It\u0027s a ResourceConsumer*Tracker*, ain\u0027t it? (I mean, it could be relevant to describe not just rpc callback consumers).","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_3cc5e55a","line":27,"in_reply_to":"9a68dd71_7b79272f","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"107b1cca013bf7e06b797a5c92ad6abe1fac9c6d","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_9048752f","line":27,"in_reply_to":"9a68dd71_7b79272f","updated":"2016-01-20 14:36:48.000000000","message":"Well, _versions is tracking local (server) versions also.  The acts of registering a version and subscribing to a version are related but distinct (right?) and if so using \"Consumer\" here can be thought to conflate them.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_9d95bee5","line":27,"in_reply_to":"ba63e191_02ee7e22","updated":"2016-01-19 14:50:59.000000000","message":"ResourceVersionsTracker?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_7b79272f","line":27,"in_reply_to":"ba63e191_9d95bee5","updated":"2016-01-20 13:17:52.000000000","message":"But what does it primarily track? I think the goal of the class is to track whether there are *consumers* for a type-version pair, hence my naming suggestion. Does it make sense?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":24,"context_line":"VERSIONS_TTL \u003d 60"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class ConsumerVersions(object):"},{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_02ee7e22","line":27,"in_reply_to":"da6ed579_9fbfdea9","updated":"2016-01-18 20:38:34.000000000","message":"I think it is a tracker, but it\u0027s tracking resource types.  If this class is going to be consumer-unaware, maybe: ResourceTypeTracker?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":28,"context_line":"    \"\"\"Class to be provided back by consumer_versions_callback."},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"},{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_9da40f09","line":31,"range":{"start_line":31,"start_character":48,"end_line":31,"end_character":54},"updated":"2016-01-18 20:38:34.000000000","message":"Suggest s/to set/register","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"},{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"},{"line_number":35,"context_line":"    the final version set via the set_version method."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_1d1a5f18","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":10},"updated":"2016-01-18 20:38:34.000000000","message":"Does it make sense to use the term \"resource\" (or, really, \"resource type\") throughout, where that\u0027s what\u0027s meant?\n\nSomewhat related, it\u0027s not clear to me whether \"consumers\" is a proper superset of \"agents\" or, in this context, essentially a synonym.  Apologies if I\u0027m not seeing something I should.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"},{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"},{"line_number":35,"context_line":"    the final version set via the set_version method."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_3d87f2b6","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":10},"in_reply_to":"ba63e191_1d1a5f18","updated":"2016-01-19 14:50:59.000000000","message":"It does, I will change all those references.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    This class is responsible for fetching the local versions of"},{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"},{"line_number":35,"context_line":"    the final version set via the set_version method."}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_76fffe34","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":10},"in_reply_to":"ba63e191_3d87f2b6","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"},{"line_number":35,"context_line":"    the final version set via the set_version method."},{"line_number":36,"context_line":"    \"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_cf5c0ef0","line":35,"range":{"start_line":34,"start_character":37,"end_line":35,"end_character":52},"updated":"2016-01-18 20:38:34.000000000","message":"Suggest something like \"...used to recalculate, for each resource type, the collection of versions that are local (sever) and/or known by one or more consumers.\" (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    versioned objects, and letting the callback to set every consumer\u0027s"},{"line_number":32,"context_line":"    object version."},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    Later on, this class can also be used to update and recalculate"},{"line_number":35,"context_line":"    the final version set via the set_version method."},{"line_number":36,"context_line":"    \"\"\""},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_5602fa3f","line":35,"range":{"start_line":34,"start_character":37,"end_line":35,"end_character":52},"in_reply_to":"ba63e191_cf5c0ef0","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":40,"context_line":"        # to send those. The _versions dictionary will be updated when"},{"line_number":41,"context_line":"        # add_version is called for each agent/consumer."},{"line_number":42,"context_line":"        self._versions \u003d resources.local_resource_versions()"},{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_bf6d0234","line":41,"updated":"2016-01-18 16:23:52.000000000","message":"you mean \u0027set_version\u0027? I actually like add_version more. Or considering the comment below, \u0027register_consumer(resource_type, resource_version)\u0027 and \u0027unregister_consumer(resource_type, resource_version)\u0027","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"107b1cca013bf7e06b797a5c92ad6abe1fac9c6d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":40,"context_line":"        # to send those. The _versions dictionary will be updated when"},{"line_number":41,"context_line":"        # add_version is called for each agent/consumer."},{"line_number":42,"context_line":"        self._versions \u003d resources.local_resource_versions()"},{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_b0d019cb","line":41,"in_reply_to":"9a68dd71_9be65be7","updated":"2016-01-20 14:36:48.000000000","message":"_versions[resource_type] is currently a set and may be an int\n\n_versions_by_consumer[consumer_id][resource_type] is a string\n\nI like \"register\" :)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":40,"context_line":"        # to send those. The _versions dictionary will be updated when"},{"line_number":41,"context_line":"        # add_version is called for each agent/consumer."},{"line_number":42,"context_line":"        self._versions \u003d resources.local_resource_versions()"},{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_565e7a46","line":41,"in_reply_to":"9a68dd71_9be65be7","updated":"2016-01-25 14:47:34.000000000","message":"it\u0027s set_version to consumer, \n\nit\u0027s not only appended, but set to an specific consumer.\n\nIt will override the previous one (for the specific consumer), if the consumer version set has changed.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":40,"context_line":"        # to send those. The _versions dictionary will be updated when"},{"line_number":41,"context_line":"        # add_version is called for each agent/consumer."},{"line_number":42,"context_line":"        self._versions \u003d resources.local_resource_versions()"},{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_9be65be7","line":41,"in_reply_to":"ba63e191_9d4a9e82","updated":"2016-01-20 13:17:52.000000000","message":"Maybe it\u0027s just me, but for me \u0027set\u0027 means \u0027set a new value, overriding the previous one\u0027, and it seems that your goal is to \u0027add (append) a version to existing tracked versions\u0027. That\u0027s why it feels more reasonable to add (or even append a version) [and if we actually use the class to track consumers as discussed above, then maybe it should be \u0027add (register) consumer\u0027.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def __init__(self):"},{"line_number":39,"context_line":"        # Initialize with the local (server) versions, as we always want"},{"line_number":40,"context_line":"        # to send those. The _versions dictionary will be updated when"},{"line_number":41,"context_line":"        # add_version is called for each agent/consumer."},{"line_number":42,"context_line":"        self._versions \u003d resources.local_resource_versions()"},{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_9d4a9e82","line":41,"in_reply_to":"da6ed579_bf6d0234","updated":"2016-01-19 14:50:59.000000000","message":"yes, set_version.\n\nI started by add \u0026 update, but that made it error prone. I prefer a single action that\u0027s smart enough and decides by it\u0027s own logic.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_ff25ba5b","line":46,"updated":"2016-01-18 16:23:52.000000000","message":"I suggest we remove those locks. we don\u0027t assume to run the code in real thread mode, yet.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_1bdb4b1d","line":46,"in_reply_to":"ba63e191_7d49ea8a","updated":"2016-01-20 13:17:52.000000000","message":"+ for TODO","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._versions_by_consumer \u003d collections.defaultdict(dict)"},{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_7d49ea8a","line":46,"in_reply_to":"da6ed579_ff25ba5b","updated":"2016-01-19 14:50:59.000000000","message":"Ack, I will remove in favor of a TODO for future reference.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":50,"context_line":"        prev_version \u003d ("}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_df78f5fa","line":47,"updated":"2016-01-18 16:23:52.000000000","message":"Why do we care about specific consumers? Why not just register and unregister *some* unknown consumers to specific versions, and track just their number per type-version pair (if it\u0027s zero, we don\u0027t have anyone caring about the version).\n\nI think it would simplify the class significantly.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":50,"context_line":"        prev_version \u003d ("}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_9b0bbb7d","line":47,"in_reply_to":"ba63e191_1d26aece","updated":"2016-01-20 13:17:52.000000000","message":"Reference counts, that\u0027s exactly what I suggested. I think for debugging matters, it should be enough to add some debug logs that would log exact agents that \u0027subscribed\u0027 (and unsubscribed) to a type-version pair.\n\nThe reason why I suggest counters is that it seems the code itself would be a lot easier to read (and hence debug) then.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self._needs_recalculation \u003d False"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":47,"context_line":"    def set_version(self, consumer_id, resource_type, version):"},{"line_number":48,"context_line":"        \"\"\"Set or update a consumer resource type version.\"\"\""},{"line_number":49,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":50,"context_line":"        prev_version \u003d ("}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_1d26aece","line":47,"in_reply_to":"da6ed579_df78f5fa","updated":"2016-01-19 14:50:59.000000000","message":"Well, that would miss cases where you still have other consumers that care about the same versions.\n\nYou need to keep track of what consumer needs what, to make sure you still have consumers caring about a resource version after you remove one.\n\n\nFor example, you have\n\n * C1: V1\n * C2: V1\n * C3: V2\n * C4: V2\n\n\nyou set C1 to V2, how do you know that still C2 cares about V1.\n\n\nWe could use reference counts by resource type \u0026 version, but if we needed to debug the situation, the information we could provide would be less detailed.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            # been set for all of its resource types."},{"line_number":59,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def resource_versions(self, resource_type):"},{"line_number":62,"context_line":"        \"\"\"Fetch the versions necessary to notify all consumers.\"\"\""},{"line_number":63,"context_line":"        if self._needs_recalculation:"},{"line_number":64,"context_line":"            self._recalculate_versions()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_af343a4a","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":25},"updated":"2016-01-18 20:38:34.000000000","message":"Can (should?) this method name use a verb?  I found this construction confusing, but that may very well be just me.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            # been set for all of its resource types."},{"line_number":59,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def resource_versions(self, resource_type):"},{"line_number":62,"context_line":"        \"\"\"Fetch the versions necessary to notify all consumers.\"\"\""},{"line_number":63,"context_line":"        if self._needs_recalculation:"},{"line_number":64,"context_line":"            self._recalculate_versions()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_c0302d59","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":25},"in_reply_to":"ba63e191_af343a4a","updated":"2016-01-19 14:50:59.000000000","message":"get_resource_versions.\n\nI, in fact, would have made the same comment.\n\nThanks Margaret.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @lockutils.synchronized(\u0027consumer-versions\u0027)"},{"line_number":70,"context_line":"    def _recalculate_versions(self):"},{"line_number":71,"context_line":"        \"\"\"Re-fetch the local (server) versions and expand with consumers\u0027.\"\"\""},{"line_number":72,"context_line":"        versions \u003d resources.local_resource_versions()"},{"line_number":73,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":74,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_4f31feeb","line":71,"range":{"start_line":71,"start_character":59,"end_line":71,"end_character":74},"updated":"2016-01-18 20:38:34.000000000","message":"Yes, this wording makes sense to me.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_179f9e60","line":80,"range":{"start_line":80,"start_character":45,"end_line":80,"end_character":54},"updated":"2016-01-18 20:38:34.000000000","message":"Is \"versioned\" redundant here?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_e020d1f9","line":80,"range":{"start_line":80,"start_character":45,"end_line":80,"end_character":54},"in_reply_to":"ba63e191_179f9e60","updated":"2016-01-19 14:50:59.000000000","message":"It is.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_6fb0828c","line":82,"range":{"start_line":82,"start_character":23,"end_line":82,"end_character":29},"updated":"2016-01-18 20:38:34.000000000","message":"\"... , either local (server) or of interest to consumers, across ... \" (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_704b415a","line":82,"updated":"2016-01-18 16:23:52.000000000","message":"please be more explicit which versions are those (resource versions)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_c0658d45","line":82,"range":{"start_line":82,"start_character":23,"end_line":82,"end_character":29},"in_reply_to":"ba63e191_6fb0828c","updated":"2016-01-19 14:50:59.000000000","message":"Thanks, will fix.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"class ResourceVersionsManager(object):"},{"line_number":80,"context_line":"    \"\"\"Singleton class in charge of tracking versioned objects versions."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    It tracks versions across the neutron distributed system of agents/"},{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_17db1e1d","line":82,"in_reply_to":"da6ed579_704b415a","updated":"2016-01-18 20:38:34.000000000","message":"\"resource-type versions\" (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_c224e6b0","line":86,"range":{"start_line":86,"start_character":37,"end_line":86,"end_character":60},"updated":"2016-01-18 20:38:34.000000000","message":"\" ... get a new instance of this ...\" (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_e2feca04","line":86,"range":{"start_line":86,"start_character":45,"end_line":86,"end_character":56},"updated":"2016-01-18 20:38:34.000000000","message":"\"a instances\" (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"107b1cca013bf7e06b797a5c92ad6abe1fac9c6d","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_d6377aae","line":86,"range":{"start_line":86,"start_character":45,"end_line":86,"end_character":56},"in_reply_to":"ba63e191_004c05c6","updated":"2016-01-20 14:36:48.000000000","message":"Sorry about my garbled comments, two of them no less.  Yes, I did intend to suggest \"new instances of this class\"!","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    consumers."},{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_004c05c6","line":86,"range":{"start_line":86,"start_character":45,"end_line":86,"end_character":56},"in_reply_to":"ba63e191_e2feca04","updated":"2016-01-19 14:50:59.000000000","message":"new instances of this class?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if not cls._singleton:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_d06d4d9a","line":87,"updated":"2016-01-18 16:23:52.000000000","message":"Can you explain why we need it to be singleton in the first place? I think we may need multiple managers later that e.g. use different sources for version extraction.\n\nIf you want your public functions in the module to work with the same instance of the manager, fine: you initialize a global object of this type in the module, and make those functions to proxy calls to this object.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if not cls._singleton:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_5b89c3c9","line":87,"in_reply_to":"ba63e191_c036ed02","updated":"2016-01-20 13:17:52.000000000","message":"I think singleton approach makes testing the code a lot harder. I prefer we go with a simple class unless there is clear argument against it. (See how we test the resource manager for rpc callbacks; it\u0027s a mess.)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    \"\"\""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    # This hook is to allow tests to get new objects for the class"},{"line_number":87,"context_line":"    _singleton \u003d True"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __new__(cls, *args, **kwargs):"},{"line_number":90,"context_line":"        if not cls._singleton:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_c036ed02","line":87,"in_reply_to":"da6ed579_d06d4d9a","updated":"2016-01-19 14:50:59.000000000","message":"Yes, we had that discussion in PS4, and it was on consideration by myself, I could go back to that, and we could reconvert it to a class if we ever need to.\n\nhttps://review.openstack.org/#/c/265347/4..7/neutron/api/rpc/callbacks/version_manager.py","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return ConsumerVersions()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def __init__(self):"},{"line_number":105,"context_line":"        self._consumer_versions_callback \u003d self._no_callback"},{"line_number":106,"context_line":"        self._expires_at \u003d 0"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_135a0f2b","line":105,"updated":"2016-01-18 16:23:52.000000000","message":"Not sure why not making the callback an argument to __init__","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return ConsumerVersions()"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def __init__(self):"},{"line_number":105,"context_line":"        self._consumer_versions_callback \u003d self._no_callback"},{"line_number":106,"context_line":"        self._expires_at \u003d 0"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_d33485df","line":105,"in_reply_to":"da6ed579_135a0f2b","updated":"2016-01-19 14:50:59.000000000","message":"Good point.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def __init__(self):"},{"line_number":105,"context_line":"        self._consumer_versions_callback \u003d self._no_callback"},{"line_number":106,"context_line":"        self._expires_at \u003d 0"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"},{"line_number":109,"context_line":"        \"\"\"Register a callback to retrieve the system consumer versions."}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_1371afa8","line":106,"updated":"2016-01-18 16:23:52.000000000","message":"add a comment here, saying 0 will mean immediate version refresh","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def __init__(self):"},{"line_number":105,"context_line":"        self._consumer_versions_callback \u003d self._no_callback"},{"line_number":106,"context_line":"        self._expires_at \u003d 0"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"},{"line_number":109,"context_line":"        \"\"\"Register a callback to retrieve the system consumer versions."}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_bbba3f6d","line":106,"in_reply_to":"ba63e191_d34b2558","updated":"2016-01-20 13:17:52.000000000","message":"Anything that slightly helps readers to understand the code. It\u0027s already quite hard to perceive.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def __init__(self):"},{"line_number":105,"context_line":"        self._consumer_versions_callback \u003d self._no_callback"},{"line_number":106,"context_line":"        self._expires_at \u003d 0"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"},{"line_number":109,"context_line":"        \"\"\"Register a callback to retrieve the system consumer versions."}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_d34b2558","line":106,"in_reply_to":"da6ed579_1371afa8","updated":"2016-01-19 14:50:59.000000000","message":"Ack. I guess you\u0027re saying it because it wasn\u0027t obvious, so I\u0027ll add it.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"},{"line_number":109,"context_line":"        \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        Specific agent logic has been decoupled from this, so we could reuse"},{"line_number":112,"context_line":"        in other places."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        The callback will not receive any parameters, and it shall return"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_33e9531b","line":111,"updated":"2016-01-18 16:23:52.000000000","message":"It makes it sound like it\u0027s running in agents. What you try to decouple is \u0027version extraction logic\u0027.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    def set_consumer_versions_callback(self, callback):"},{"line_number":109,"context_line":"        \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        Specific agent logic has been decoupled from this, so we could reuse"},{"line_number":112,"context_line":"        in other places."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        The callback will not receive any parameters, and it shall return"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_536e55ca","line":111,"in_reply_to":"da6ed579_33e9531b","updated":"2016-01-19 14:50:59.000000000","message":"I\u0027ll fix.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"dc7d3f84e1080a642337dd813335681ddfe9549c","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        in other places."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        The callback will not receive any parameters, and it shall return"},{"line_number":115,"context_line":"        a ConsumerVersions object with any version the agents of the"},{"line_number":116,"context_line":"        distributed system are expecting added to it."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        self._consumer_versions_callback \u003d callback"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_fd3bcb9a","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":9},"updated":"2016-01-18 20:38:34.000000000","message":"the (?)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"107b1cca013bf7e06b797a5c92ad6abe1fac9c6d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        in other places."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        The callback will not receive any parameters, and it shall return"},{"line_number":115,"context_line":"        a ConsumerVersions object with any version the agents of the"},{"line_number":116,"context_line":"        distributed system are expecting added to it."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        self._consumer_versions_callback \u003d callback"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_f6087edb","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":9},"in_reply_to":"ba63e191_d3b9e52f","updated":"2016-01-20 14:36:48.000000000","message":"Thanks for that. I wasn\u0027t sure which way it went.  I think, given the use case, it makes more sense as a singleton, but I suspect that that belief betrays confusion on my part more than anything else.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        in other places."},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        The callback will not receive any parameters, and it shall return"},{"line_number":115,"context_line":"        a ConsumerVersions object with any version the agents of the"},{"line_number":116,"context_line":"        distributed system are expecting added to it."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        self._consumer_versions_callback \u003d callback"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_d3b9e52f","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":9},"in_reply_to":"ba63e191_fd3bcb9a","updated":"2016-01-19 14:50:59.000000000","message":"Well, I think \u0027a\u0027 is more correct?, it doesn\u0027t be an specific object (the object..), it has to be an object of the (currently called) ConsumerVersions class.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _update_consumer_versions(self):"},{"line_number":121,"context_line":"        versions \u003d self._consumer_versions_callback()"},{"line_number":122,"context_line":"        if versions is None or versions.__class__ !\u003d ConsumerVersions:"},{"line_number":123,"context_line":"            raise exceptions.VersionsCallbackWrongResult()"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.versions \u003d versions"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_5f5e4546","line":122,"updated":"2016-01-18 16:23:52.000000000","message":"nit: first check is redundant","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _update_consumer_versions(self):"},{"line_number":121,"context_line":"        versions \u003d self._consumer_versions_callback()"},{"line_number":122,"context_line":"        if versions is None or versions.__class__ !\u003d ConsumerVersions:"},{"line_number":123,"context_line":"            raise exceptions.VersionsCallbackWrongResult()"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.versions \u003d versions"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_f38d097c","line":122,"in_reply_to":"da6ed579_5f5e4546","updated":"2016-01-19 14:50:59.000000000","message":"oh, \n   \u003e\u003e None.__class__\n   \u003ctype \u0027NoneType\u0027\u003e\n\n:)","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            self._expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def set_version(self, client_id, resource_type, resource_version):"},{"line_number":133,"context_line":"        \"\"\"Update a client version for a resource type."},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":136,"context_line":"        consumers which boot up and quickly want to update the versions cache"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_02ecf227","line":133,"updated":"2016-01-18 16:23:52.000000000","message":"client? you mean consumer?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            self._expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def set_version(self, client_id, resource_type, resource_version):"},{"line_number":133,"context_line":"        \"\"\"Update a client version for a resource type."},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        This function is meant to be used on server fanout notifications from"},{"line_number":136,"context_line":"        consumers which boot up and quickly want to update the versions cache"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_33c2c186","line":133,"in_reply_to":"da6ed579_02ecf227","updated":"2016-01-19 14:50:59.000000000","message":"yes","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        return self.versions.resource_versions(resource_type)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"def _calculate_client_id(agent_type, agent_host):"},{"line_number":150,"context_line":"    return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":151,"context_line":"                                              \u0027agent_host\u0027: agent_host}"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_829ea252","line":149,"updated":"2016-01-18 16:23:52.000000000","message":"I don\u0027t see any code that would *really* care about client_id in the first place. We could just track the number of consumers interested in a specific version of a specific resource type.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"294b03e95cdf644637b6ea4985152779795bf1fc","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        return self.versions.resource_versions(resource_type)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"def _calculate_client_id(agent_type, agent_host):"},{"line_number":150,"context_line":"    return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":151,"context_line":"                                              \u0027agent_host\u0027: agent_host}"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_bb71dfe2","line":149,"in_reply_to":"ba63e191_33708172","updated":"2016-01-20 13:17:52.000000000","message":"I suspect there are easier ways to detect it (like yum and systemctl).","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9dc1d770237e75466980846c399cee327d29e179","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        return self.versions.resource_versions(resource_type)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"def _calculate_client_id(agent_type, agent_host):"},{"line_number":150,"context_line":"    return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":151,"context_line":"                                              \u0027agent_host\u0027: agent_host}"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_33708172","line":149,"in_reply_to":"da6ed579_829ea252","updated":"2016-01-19 14:50:59.000000000","message":"Yes, that would be a probably more efficient way to implement it.\n\nBut I thought we could use the current mapping to provide periodic reports on which agents are updated, and which agents are still to be updated during the upgrade process.\n\nWhat do you think?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def _calculate_consumer_id(agent_type, agent_host):"},{"line_number":71,"context_line":"        return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":72,"context_line":"                                                  \u0027agent_host\u0027: agent_host}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    # TODO(mangelajo): add locking with _recalculate_versions if we ever"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_2ed4bd45","line":71,"updated":"2016-01-26 14:35:08.000000000","message":"by any chance, could we have multiple agents of the same type on the same host?\n\nAlso, since the class is Consumer tracker, not agent tracker, I would suggest to avoid using \u0027agent\u0027 term here.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def _calculate_consumer_id(agent_type, agent_host):"},{"line_number":71,"context_line":"        return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":72,"context_line":"                                                  \u0027agent_host\u0027: agent_host}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    # TODO(mangelajo): add locking with _recalculate_versions if we ever"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_97f0e668","line":71,"in_reply_to":"5a5ae5dd_5b0dfd3c","updated":"2016-02-05 17:25:59.000000000","message":"Correct, I\u0027m sending now a non-submited comment for it. So no two agents of the same type per host.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1e7ae2f3d737255effb055d3da6845e99620b773","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def _calculate_consumer_id(agent_type, agent_host):"},{"line_number":71,"context_line":"        return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":72,"context_line":"                                                  \u0027agent_host\u0027: agent_host}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    # TODO(mangelajo): add locking with _recalculate_versions if we ever"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_5b0dfd3c","line":71,"in_reply_to":"7a5de9d1_9bb3bf0a","updated":"2016-02-04 09:04:17.000000000","message":"I checked, it\u0027s indeed not designed to run two agents of the same type on a host. Though I remember that once we did multiple external networks for L3 agent by running multiple instances of it, so there is some history of doing it.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def _calculate_consumer_id(agent_type, agent_host):"},{"line_number":71,"context_line":"        return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":72,"context_line":"                                                  \u0027agent_host\u0027: agent_host}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    # TODO(mangelajo): add locking with _recalculate_versions if we ever"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_a3b52d7f","line":71,"in_reply_to":"7a5de9d1_9bb3bf0a","updated":"2016-02-05 17:25:59.000000000","message":"https://github.com/openstack/neutron/blob/master/neutron/db/agents_db.py#L317\n\nOk, my understanding was correct, agent\u0027s are fetched from db based on type and host only. So we shall not have two agents with the same type and host.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @staticmethod"},{"line_number":70,"context_line":"    def _calculate_consumer_id(agent_type, agent_host):"},{"line_number":71,"context_line":"        return \"%(agent_type)s@%(agent_host)s\" % {\u0027agent_type\u0027: agent_type,"},{"line_number":72,"context_line":"                                                  \u0027agent_host\u0027: agent_host}"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    # TODO(mangelajo): add locking with _recalculate_versions if we ever"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_9bb3bf0a","line":71,"in_reply_to":"9a68dd71_2ed4bd45","updated":"2016-01-27 12:03:21.000000000","message":"By design, we can\u0027t have multiple agents of the same type on the same host as far as I understood, they would overwrite each other on the normal status reports.\n\nAnd agent\u0027s afaik don\u0027t know their ID when they report stuff back to neutron, they use the type/host pair, but I will double check I\u0027m not making a dumb assumption here.\n\nOk, let\u0027s use consumer type/ consumer host","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9551,"name":"Martin Hickey","email":"martin.hickey@ie.ibm.com","username":"mhickey"},"change_message_id":"1410c653e6a7277af61691b2d9c2440a589502d4","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":80,"context_line":"        prev_version \u003d ("},{"line_number":81,"context_line":"            self._versions_by_consumer[consumer_id].get(resource_type, None))"},{"line_number":82,"context_line":"        self._versions_by_consumer[consumer_id][resource_type] \u003d version"},{"line_number":83,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":84,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":85,"context_line":"            # recalculate the main dictionary of versions based on the"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_0d50070a","line":82,"range":{"start_line":82,"start_character":65,"end_line":82,"end_character":72},"updated":"2016-01-25 20:24:21.000000000","message":"Were you supposed to add a log if the version is an older version than prev_version?","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"80e4d0b9630deeb133639d0598690ecdf3fcfdaf","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        self._versions[resource_type].add(version)"},{"line_number":80,"context_line":"        prev_version \u003d ("},{"line_number":81,"context_line":"            self._versions_by_consumer[consumer_id].get(resource_type, None))"},{"line_number":82,"context_line":"        self._versions_by_consumer[consumer_id][resource_type] \u003d version"},{"line_number":83,"context_line":"        if prev_version and (prev_version !\u003d version):"},{"line_number":84,"context_line":"            # If a version got updated/changed in a consumer, we need to"},{"line_number":85,"context_line":"            # recalculate the main dictionary of versions based on the"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_6402e30d","line":82,"range":{"start_line":82,"start_character":65,"end_line":82,"end_character":72},"in_reply_to":"9a68dd71_0d50070a","updated":"2016-01-26 11:22:32.000000000","message":"Hmm, I will add that, it seems like a reasonable thing to warn about. And probably some extra debug logs around the process may help too, specially at the start.\n\nThanks Martin. I will do","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            # been set for all of its resource types."},{"line_number":89,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def set_versions(self, agent_type, agent_host, versions):"},{"line_number":92,"context_line":"        \"\"\"Set or update an specific consumer resource types.\"\"\""},{"line_number":93,"context_line":"        for resource_type, resource_version in versions.items():"},{"line_number":94,"context_line":"            self.set_version(agent_type, agent_host, resource_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_8e7b6929","line":91,"updated":"2016-01-26 14:35:08.000000000","message":"Any reason to have both set_version and set_versions as public API?","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            # been set for all of its resource types."},{"line_number":89,"context_line":"            self._needs_recalculation \u003d True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def set_versions(self, agent_type, agent_host, versions):"},{"line_number":92,"context_line":"        \"\"\"Set or update an specific consumer resource types.\"\"\""},{"line_number":93,"context_line":"        for resource_type, resource_version in versions.items():"},{"line_number":94,"context_line":"            self.set_version(agent_type, agent_host, resource_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_5207dc17","line":91,"in_reply_to":"9a68dd71_8e7b6929","updated":"2016-02-05 17:25:59.000000000","message":"I think there\u0027s None. So cleaning that out.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    # TODO(mangelajo): Add locking if we ever move out of greenthreads."},{"line_number":106,"context_line":"    def _recalculate_versions(self):"},{"line_number":107,"context_line":"        \"\"\"Re-fetch the local (server) versions and expand with consumers\u0027.\"\"\""},{"line_number":108,"context_line":"        versions \u003d self._get_local_resource_versions()"},{"line_number":109,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":110,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_ee01c56b","line":107,"range":{"start_line":107,"start_character":73,"end_line":107,"end_character":74},"updated":"2016-01-26 14:35:08.000000000","message":"redundant quote? Or mean: \"and expand with versions used by known consumers\"?","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    # TODO(mangelajo): Add locking if we ever move out of greenthreads."},{"line_number":106,"context_line":"    def _recalculate_versions(self):"},{"line_number":107,"context_line":"        \"\"\"Re-fetch the local (server) versions and expand with consumers\u0027.\"\"\""},{"line_number":108,"context_line":"        versions \u003d self._get_local_resource_versions()"},{"line_number":109,"context_line":"        for versions_dict in self._versions_by_consumer.values():"},{"line_number":110,"context_line":"            for res_type, res_version in versions_dict.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_7b236306","line":107,"range":{"start_line":107,"start_character":73,"end_line":107,"end_character":74},"in_reply_to":"9a68dd71_ee01c56b","updated":"2016-01-27 12:03:21.000000000","message":"No, I was trying to say what you said: consumers\u0027 know versions. By I omitted the possessed thing to shorten the phrase.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self._versions \u003d versions"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"_consumer_versions_callback \u003d None"},{"line_number":116,"context_line":"_expires_at \u003d 0  # This is TTL expiration, 0 means it will be expired at start"},{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_4ee491ab","line":115,"updated":"2016-01-26 14:35:08.000000000","message":"All those should belong to the tracker. Globals are evil.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self._versions \u003d versions"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"_consumer_versions_callback \u003d None"},{"line_number":116,"context_line":"_expires_at \u003d 0  # This is TTL expiration, 0 means it will be expired at start"},{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_526cbccf","line":115,"in_reply_to":"5a5ae5dd_9e20439d","updated":"2016-02-05 17:25:59.000000000","message":"Lol :) I forgot it. :D chance lost :D. Finishing it, I hope it will look better.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1e7ae2f3d737255effb055d3da6845e99620b773","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self._versions \u003d versions"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"_consumer_versions_callback \u003d None"},{"line_number":116,"context_line":"_expires_at \u003d 0  # This is TTL expiration, 0 means it will be expired at start"},{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_9e20439d","line":115,"in_reply_to":"7a5de9d1_1b4eefc1","updated":"2016-02-04 09:04:17.000000000","message":"You have not killed me even though you had a chance on FOSDEM. So now please refactor instead. :P","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self._versions \u003d versions"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"_consumer_versions_callback \u003d None"},{"line_number":116,"context_line":"_expires_at \u003d 0  # This is TTL expiration, 0 means it will be expired at start"},{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_1b4eefc1","line":115,"in_reply_to":"9a68dd71_4ee491ab","updated":"2016-01-27 12:03:21.000000000","message":"I\u0027m going to kill you :) (gently)\n\nThis is why I was using a singleton class to encapsulate those globals and separate the tracker itself, and the version managing interface an TTL mechanism in two separate classes.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def cleanup():"},{"line_number":121,"context_line":"    \"\"\"Function used in testing to reset the global state of this module.\"\"\""},{"line_number":122,"context_line":"    global _consumer_versions_callback, _expires_at, _versions"},{"line_number":123,"context_line":"    _consumer_versions_callback \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_cee641b0","line":120,"updated":"2016-01-26 14:35:08.000000000","message":"I would prefer not to have any global state, or at least hide it after a single global object (the tracker).","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"1b1e0885a0661a49469d3dfcd472e77a159c31a1","unresolved":false,"context_lines":[{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def cleanup():"},{"line_number":121,"context_line":"    \"\"\"Function used in testing to reset the global state of this module.\"\"\""},{"line_number":122,"context_line":"    global _consumer_versions_callback, _expires_at, _versions"},{"line_number":123,"context_line":"    _consumer_versions_callback \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_d024b1b0","line":120,"in_reply_to":"7a5de9d1_bba31b4f","updated":"2016-01-27 12:29:09.000000000","message":"Ok, ode to my own idiocy, this is what you said:\n\n\"\"\"\nIf you want your public functions in the module to work with the same instance of the manager, fine: you initialize a global object of this type in the module, and make those functions to proxy calls to this object.\n\n\"\"\" \n\nMaking the original \"singleton object\" global, not making the methods global to the module.\n\nCan you recommend me a book that explains how to read? :-P","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":117,"context_line":"_versions \u003d ResourceConsumerTracker()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def cleanup():"},{"line_number":121,"context_line":"    \"\"\"Function used in testing to reset the global state of this module.\"\"\""},{"line_number":122,"context_line":"    global _consumer_versions_callback, _expires_at, _versions"},{"line_number":123,"context_line":"    _consumer_versions_callback \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_bba31b4f","line":120,"in_reply_to":"9a68dd71_cee641b0","updated":"2016-01-27 12:03:21.000000000","message":"Ditto.\n\nI will try to see if I can make it work into a single object without making the design cluttered. But I will need it to make it singleton again.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    _versions \u003d ResourceConsumerTracker()"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"def _update_consumer_versions():"},{"line_number":129,"context_line":"    global _versions"},{"line_number":130,"context_line":"    if _consumer_versions_callback:"},{"line_number":131,"context_line":"        versions \u003d _consumer_versions_callback()"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_2e4efd96","line":128,"updated":"2016-01-26 14:35:08.000000000","message":"That could easily belong to the tracker.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    global _versions"},{"line_number":130,"context_line":"    if _consumer_versions_callback:"},{"line_number":131,"context_line":"        versions \u003d _consumer_versions_callback()"},{"line_number":132,"context_line":"        if versions is None or versions.__class__ !\u003d ResourceConsumerTracker:"},{"line_number":133,"context_line":"            raise exceptions.VersionsCallbackWrongResult()"},{"line_number":134,"context_line":"        _versions \u003d versions"},{"line_number":135,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_eeb9c57a","line":132,"updated":"2016-01-26 14:35:08.000000000","message":"I said it before but: the first check is redundant.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    global _versions"},{"line_number":130,"context_line":"    if _consumer_versions_callback:"},{"line_number":131,"context_line":"        versions \u003d _consumer_versions_callback()"},{"line_number":132,"context_line":"        if versions is None or versions.__class__ !\u003d ResourceConsumerTracker:"},{"line_number":133,"context_line":"            raise exceptions.VersionsCallbackWrongResult()"},{"line_number":134,"context_line":"        _versions \u003d versions"},{"line_number":135,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_9bb5ff7f","line":132,"in_reply_to":"9a68dd71_eeb9c57a","updated":"2016-01-27 12:03:21.000000000","message":"True, this fix was not done. I\u0027ll fix it.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        _expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"def set_consumer_versions_callback(callback):"},{"line_number":147,"context_line":"    \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    Specific agent logic has been decoupled from this, so we could reuse"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_225b7130","line":146,"updated":"2016-01-26 14:35:08.000000000","message":"You may later need to have multiple callbacks, so would be safe and allow multiple callbacks registered.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"1e7ae2f3d737255effb055d3da6845e99620b773","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        _expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"def set_consumer_versions_callback(callback):"},{"line_number":147,"context_line":"    \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    Specific agent logic has been decoupled from this, so we could reuse"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_be5adf28","line":146,"in_reply_to":"7a5de9d1_3b7e4baf","updated":"2016-02-04 09:04:17.000000000","message":"OK, as long as the module is not for public consumption (you could e.g. rename the module to have an underscore at the start).","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fc9b0a958bae2220a17b044dfc90e131894ddab1","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        _expires_at \u003d time.time() + VERSIONS_TTL"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"def set_consumer_versions_callback(callback):"},{"line_number":147,"context_line":"    \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    Specific agent logic has been decoupled from this, so we could reuse"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_3b7e4baf","line":146,"in_reply_to":"9a68dd71_225b7130","updated":"2016-01-27 12:03:21.000000000","message":"IMHO that\u0027s a YAGNI.\n\nLet\u0027s work on that when we need it.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":146,"context_line":"def set_consumer_versions_callback(callback):"},{"line_number":147,"context_line":"    \"\"\"Register a callback to retrieve the system consumer versions."},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    Specific agent logic has been decoupled from this, so we could reuse"},{"line_number":150,"context_line":"    in other places."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    The callback will not receive any parameters, and it shall return"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_0e177955","line":149,"range":{"start_line":149,"start_character":4,"end_line":149,"end_character":43},"updated":"2016-01-26 14:35:08.000000000","message":"Specific consumer versions\u0027 extraction logic has been decoupled...","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    in other places."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    The callback will not receive any parameters, and it shall return"},{"line_number":153,"context_line":"    a ResourceConsumerTracker object with any version the agents of the"},{"line_number":154,"context_line":"    distributed system are expecting added to it."},{"line_number":155,"context_line":"    \"\"\""},{"line_number":156,"context_line":"    global _consumer_versions_callback"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_6e02b50d","line":153,"range":{"start_line":153,"start_character":58,"end_line":153,"end_character":64},"updated":"2016-01-26 14:35:08.000000000","message":"consumers","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    in other places."},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    The callback will not receive any parameters, and it shall return"},{"line_number":153,"context_line":"    a ResourceConsumerTracker object with any version the agents of the"},{"line_number":154,"context_line":"    distributed system are expecting added to it."},{"line_number":155,"context_line":"    \"\"\""},{"line_number":156,"context_line":"    global _consumer_versions_callback"},{"line_number":157,"context_line":"    _consumer_versions_callback \u003d callback"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_02a42d06","line":154,"range":{"start_line":153,"start_character":42,"end_line":154,"end_character":48},"updated":"2016-01-26 14:35:08.000000000","message":"\"all resource versions consumed by registered consumers\"","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"def get_resource_versions(resource_type):"},{"line_number":161,"context_line":"    \"\"\"Return the set of versions expected by the consumers of a resource.\"\"\""},{"line_number":162,"context_line":"    _check_expiration()"},{"line_number":163,"context_line":"    return _versions.get_resource_versions(resource_type)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_4236a5b5","line":162,"updated":"2016-01-26 14:35:08.000000000","message":"Expiration logic probably belongs to the tracker itself.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":163,"context_line":"    return _versions.get_resource_versions(resource_type)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"def update_version(agent_type, agent_host, resource_type, resource_version):"},{"line_number":167,"context_line":"    \"\"\"Update a resource version for an agent_type/agent_host pair.\"\"\""},{"line_number":168,"context_line":"    _versions.set_version(agent_type, agent_host, resource_type,"},{"line_number":169,"context_line":"                          resource_version)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_c2713579","line":166,"updated":"2016-01-26 14:35:08.000000000","message":"again, avoid \u0027agent\u0027 terms here and below.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                          resource_version)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"def update_versions(agent_type, agent_host, resource_versions):"},{"line_number":173,"context_line":"    \"\"\"Update the resources\u0027 versions for an agent_type/agent_host pair.\"\"\""},{"line_number":174,"context_line":"    _versions.set_versions(agent_type, agent_host, resource_versions)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_c2f855c7","line":172,"updated":"2016-01-26 14:35:08.000000000","message":"it\u0027s set in the tracker, but update here. For what reason?","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"39c046ffcc3bee5b89275a720ee70b856a61f010","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                          resource_version)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"def update_versions(agent_type, agent_host, resource_versions):"},{"line_number":173,"context_line":"    \"\"\"Update the resources\u0027 versions for an agent_type/agent_host pair.\"\"\""},{"line_number":174,"context_line":"    _versions.set_versions(agent_type, agent_host, resource_versions)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a5de9d1_30f185ce","line":172,"in_reply_to":"9a68dd71_c2f855c7","updated":"2016-01-27 12:35:25.000000000","message":"because initial set is supposed to be done only within a callback. \n\nAnd this method is expected to be used for updates outside of the callback scope. I wanted to make that clear.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"217e8d1711ef6c53e636c679c22639dffb893b0c","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._versions.set_versions(consumer_id, resource_versions)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"cached_version_tracker \u003d CachedResourceConsumerTracker()"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def set_consumer_versions_callback(callback):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_636bd585","line":152,"updated":"2016-02-08 17:09:15.000000000","message":"Yes, that\u0027s the way! Thanks for refactoring.","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"43a6240a14555cc605b8dece4875524bc5670609","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self._versions.set_versions(consumer_id, resource_versions)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"cached_version_tracker \u003d CachedResourceConsumerTracker()"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"def set_consumer_versions_callback(callback):"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_df78302e","line":152,"in_reply_to":"5a5ae5dd_636bd585","updated":"2016-02-09 09:02:08.000000000","message":"You\u0027re welcome, thanks for the comments, I\u0027m much more satisfied about how it looks now.","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"}],"neutron/api/rpc/handlers/resources_rpc.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e59a1906244b42cb8142a614e00f593f9d297a86","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        resource_type \u003d resources.get_resource_type(resource)"},{"line_number":142,"context_line":"        _validate_resource_type(resource_type)"},{"line_number":143,"context_line":"        versions \u003d ("},{"line_number":144,"context_line":"            version_manager.ResourcesVersionsManager.version_manager("},{"line_number":145,"context_line":"                resource_type))"},{"line_number":146,"context_line":"        for version in versions:"},{"line_number":147,"context_line":"            cctxt \u003d self._prepare_object_fanout_context(resource)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_bae46f0d","line":144,"range":{"start_line":144,"start_character":53,"end_line":144,"end_character":68},"updated":"2016-01-12 08:09:19.000000000","message":"It seems this method does not exist....\n\nresource_versions?","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"4da4e6ffcda22e27473cf0bb86e5e042a293638a","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        resource_type \u003d resources.get_resource_type(resource)"},{"line_number":142,"context_line":"        _validate_resource_type(resource_type)"},{"line_number":143,"context_line":"        versions \u003d ("},{"line_number":144,"context_line":"            version_manager.ResourcesVersionsManager.version_manager("},{"line_number":145,"context_line":"                resource_type))"},{"line_number":146,"context_line":"        for version in versions:"},{"line_number":147,"context_line":"            cctxt \u003d self._prepare_object_fanout_context(resource)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_b89c5c6a","line":144,"range":{"start_line":144,"start_character":53,"end_line":144,"end_character":68},"in_reply_to":"da6ed579_af542254","updated":"2016-01-12 18:01:00.000000000","message":"Done","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8040c397d3466fd37be0b216a4cd0ab7ce7aaaab","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        resource_type \u003d resources.get_resource_type(resource)"},{"line_number":142,"context_line":"        _validate_resource_type(resource_type)"},{"line_number":143,"context_line":"        versions \u003d ("},{"line_number":144,"context_line":"            version_manager.ResourcesVersionsManager.version_manager("},{"line_number":145,"context_line":"                resource_type))"},{"line_number":146,"context_line":"        for version in versions:"},{"line_number":147,"context_line":"            cctxt \u003d self._prepare_object_fanout_context(resource)"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_af542254","line":144,"range":{"start_line":144,"start_character":53,"end_line":144,"end_character":68},"in_reply_to":"da6ed579_bae46f0d","updated":"2016-01-12 11:56:52.000000000","message":"Yes, sorry,  it\u0027s broken, I forgot to upload the fix locally, will be on next PS.\n\nI\u0027m reworking it btw, version_manager.ResourceVersionsManager().resource_versions( is a bit insane...","commit_id":"d82f62b9a08885dda90a5627ec56b6887b77c0e9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise InvalidResourceTypeClass(resource_type\u003dresource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def resource_type_versioned_topic(resource_type, version\u003dNone):"},{"line_number":54,"context_line":"    _validate_resource_type(resource_type)"},{"line_number":55,"context_line":"    cls \u003d resources.get_resource_cls(resource_type)"},{"line_number":56,"context_line":"    return topics.RESOURCE_TOPIC_PATTERN % {\u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_62892eca","line":53,"updated":"2016-01-18 16:23:52.000000000","message":"I don\u0027t see where you pass version here. I guess the code is not complete.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise InvalidResourceTypeClass(resource_type\u003dresource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def resource_type_versioned_topic(resource_type, version\u003dNone):"},{"line_number":54,"context_line":"    _validate_resource_type(resource_type)"},{"line_number":55,"context_line":"    cls \u003d resources.get_resource_cls(resource_type)"},{"line_number":56,"context_line":"    return topics.RESOURCE_TOPIC_PATTERN % {\u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_9be73bac","line":53,"in_reply_to":"da6ed579_62892eca","updated":"2016-01-25 14:47:34.000000000","message":"Done","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _prepare_object_fanout_context(self, obj):"},{"line_number":135,"context_line":"        \"\"\"Prepare fanout context, one topic per object type.\"\"\""},{"line_number":136,"context_line":"        obj_topic \u003d resource_type_versioned_topic(obj.obj_name())"},{"line_number":137,"context_line":"        return self.client.prepare(fanout\u003dTrue, topic\u003dobj_topic)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @log_helpers.log_method_call"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_22e576a7","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":49},"updated":"2016-01-18 16:23:52.000000000","message":"I think you want to pass version to the method and proxy it into resource_type_versioned_topic(), aren\u0027t you? Because currently you push old versions on a topic for new versions.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _prepare_object_fanout_context(self, obj):"},{"line_number":135,"context_line":"        \"\"\"Prepare fanout context, one topic per object type.\"\"\""},{"line_number":136,"context_line":"        obj_topic \u003d resource_type_versioned_topic(obj.obj_name())"},{"line_number":137,"context_line":"        return self.client.prepare(fanout\u003dTrue, topic\u003dobj_topic)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @log_helpers.log_method_call"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_db9a93c5","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":49},"in_reply_to":"da6ed579_22e576a7","updated":"2016-01-25 14:47:34.000000000","message":"Good catch, thanks.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6eaa4718e86b8332b5c0b1a1fa82ad342f0e2c90","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        _validate_resource_type(resource_type)"},{"line_number":143,"context_line":"        versions \u003d version_manager.resource_versions(resource_type)"},{"line_number":144,"context_line":"        for version in versions:"},{"line_number":145,"context_line":"            cctxt \u003d self._prepare_object_fanout_context(resource)"},{"line_number":146,"context_line":"            dehydrated_resource \u003d resource.obj_to_primitive("},{"line_number":147,"context_line":"                target_version\u003dversion)"},{"line_number":148,"context_line":"            cctxt.cast(context, \u0027push\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"da6ed579_4272ea12","line":145,"updated":"2016-01-18 16:23:52.000000000","message":"shouldn\u0027t we pass version here?","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"75705bdbf8811a320558d5b77415964f91256a21","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        _validate_resource_type(resource_type)"},{"line_number":143,"context_line":"        versions \u003d version_manager.resource_versions(resource_type)"},{"line_number":144,"context_line":"        for version in versions:"},{"line_number":145,"context_line":"            cctxt \u003d self._prepare_object_fanout_context(resource)"},{"line_number":146,"context_line":"            dehydrated_resource \u003d resource.obj_to_primitive("},{"line_number":147,"context_line":"                target_version\u003dversion)"},{"line_number":148,"context_line":"            cctxt.cast(context, \u0027push\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_5be78312","line":145,"in_reply_to":"da6ed579_4272ea12","updated":"2016-01-25 14:47:34.000000000","message":"correct!\n\nDone.","commit_id":"eabfae1d3df1e5c21962a7c4f9f80976388336cf"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise InvalidResourceTypeClass(resource_type\u003dresource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def resource_type_versioned_topic(resource_type, version\u003dNone):"},{"line_number":54,"context_line":"    _validate_resource_type(resource_type)"},{"line_number":55,"context_line":"    cls \u003d resources.get_resource_cls(resource_type)"},{"line_number":56,"context_line":"    return topics.RESOURCE_TOPIC_PATTERN % {\u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_c294d545","line":53,"updated":"2016-01-26 14:35:08.000000000","message":"version seems to allways pass as an argument.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c73316321e86c340d9f700e0837935c6b28ef2cd","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise InvalidResourceTypeClass(resource_type\u003dresource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def resource_type_versioned_topic(resource_type, version\u003dNone):"},{"line_number":54,"context_line":"    _validate_resource_type(resource_type)"},{"line_number":55,"context_line":"    cls \u003d resources.get_resource_cls(resource_type)"},{"line_number":56,"context_line":"    return topics.RESOURCE_TOPIC_PATTERN % {\u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_eabec8ac","line":53,"in_reply_to":"5a5ae5dd_cd9c7d10","updated":"2016-02-08 11:05:27.000000000","message":"Oh, it was used:\n\nhttp://logs.openstack.org/47/265347/10/check/gate-neutron-pep8-constraints/0c190ef/console.html#_2016-02-07_07_11_20_121\n\nAnd I guess we should keep it for backwards compatibility, extensions could be using it, and it seems awkward to provide the version yourself in the extension.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        raise InvalidResourceTypeClass(resource_type\u003dresource_type)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def resource_type_versioned_topic(resource_type, version\u003dNone):"},{"line_number":54,"context_line":"    _validate_resource_type(resource_type)"},{"line_number":55,"context_line":"    cls \u003d resources.get_resource_cls(resource_type)"},{"line_number":56,"context_line":"    return topics.RESOURCE_TOPIC_PATTERN % {\u0027resource_type\u0027: resource_type,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_cd9c7d10","line":53,"in_reply_to":"9a68dd71_c294d545","updated":"2016-02-05 17:25:59.000000000","message":"Done","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"304754e5cf0efbaf3e6adeaa78ae93ccedae1078","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            namespace\u003dconstants.RPC_NAMESPACE_RESOURCES)"},{"line_number":132,"context_line":"        self.client \u003d n_rpc.get_client(target)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _prepare_object_fanout_context(self, obj, version\u003dNone):"},{"line_number":135,"context_line":"        \"\"\"Prepare fanout context, one topic per object type.\"\"\""},{"line_number":136,"context_line":"        obj_topic \u003d resource_type_versioned_topic(obj.obj_name(), version)"},{"line_number":137,"context_line":"        return self.client.prepare(fanout\u003dTrue, topic\u003dobj_topic)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_a21681ef","line":134,"updated":"2016-01-26 14:35:08.000000000","message":"No reason to set the default value to None: the argument is always passed.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            namespace\u003dconstants.RPC_NAMESPACE_RESOURCES)"},{"line_number":132,"context_line":"        self.client \u003d n_rpc.get_client(target)"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def _prepare_object_fanout_context(self, obj, version\u003dNone):"},{"line_number":135,"context_line":"        \"\"\"Prepare fanout context, one topic per object type.\"\"\""},{"line_number":136,"context_line":"        obj_topic \u003d resource_type_versioned_topic(obj.obj_name(), version)"},{"line_number":137,"context_line":"        return self.client.prepare(fanout\u003dTrue, topic\u003dobj_topic)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_eda13947","line":134,"in_reply_to":"9a68dd71_a21681ef","updated":"2016-02-05 17:25:59.000000000","message":"Done","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"}],"neutron/tests/unit/api/rpc/callbacks/test_version_manager.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"217e8d1711ef6c53e636c679c22639dffb893b0c","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class ResourceConsumerTrackerTest(base.BaseTestCase):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_consumer_set_version(self):"},{"line_number":37,"context_line":"        cv \u003d version_manager.ResourceConsumerTracker()"},{"line_number":38,"context_line":"        cv.set_versions(CONSUMER_1, {TEST_RESOURCE_TYPE:"},{"line_number":39,"context_line":"                                     TEST_RESOURCE_VERSION_A})"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_af420cac","line":36,"updated":"2016-02-08 17:09:15.000000000","message":"set_versions?","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"aff006129a888072be7d5ac50167e66b21e56a71","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class ResourceConsumerTrackerTest(base.BaseTestCase):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_consumer_set_version(self):"},{"line_number":37,"context_line":"        cv \u003d version_manager.ResourceConsumerTracker()"},{"line_number":38,"context_line":"        cv.set_versions(CONSUMER_1, {TEST_RESOURCE_TYPE:"},{"line_number":39,"context_line":"                                     TEST_RESOURCE_VERSION_A})"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_8116d7ef","line":36,"in_reply_to":"5a5ae5dd_af420cac","updated":"2016-02-09 10:58:19.000000000","message":"Done","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"217e8d1711ef6c53e636c679c22639dffb893b0c","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                      cached_tracker.get_resource_versions("},{"line_number":98,"context_line":"                          TEST_RESOURCE_TYPE))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def test_update_version(self):"},{"line_number":101,"context_line":"        cached_tracker \u003d version_manager.CachedResourceConsumerTracker()"},{"line_number":102,"context_line":"        self._set_consumer_versions_callback(cached_tracker)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_4fa118f7","line":100,"updated":"2016-02-08 17:09:15.000000000","message":"I don\u0027t see you calling any update_version() function here.","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"aff006129a888072be7d5ac50167e66b21e56a71","unresolved":false,"context_lines":[{"line_number":97,"context_line":"                      cached_tracker.get_resource_versions("},{"line_number":98,"context_line":"                          TEST_RESOURCE_TYPE))"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def test_update_version(self):"},{"line_number":101,"context_line":"        cached_tracker \u003d version_manager.CachedResourceConsumerTracker()"},{"line_number":102,"context_line":"        self._set_consumer_versions_callback(cached_tracker)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_218e0328","line":100,"in_reply_to":"5a5ae5dd_4fa118f7","updated":"2016-02-09 10:58:19.000000000","message":"Done","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"217e8d1711ef6c53e636c679c22639dffb893b0c","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        self.assertNotEqual(initial_versions, final_versions)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def test_update_versions(self):"},{"line_number":116,"context_line":"        cached_tracker \u003d version_manager.CachedResourceConsumerTracker()"},{"line_number":117,"context_line":"        self._set_consumer_versions_callback(cached_tracker)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_ef7a4476","line":115,"updated":"2016-02-08 17:09:15.000000000","message":"Seems like the test validates what the previous one does, plus some more. Should we kill the first one?","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"43a6240a14555cc605b8dece4875524bc5670609","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        self.assertNotEqual(initial_versions, final_versions)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def test_update_versions(self):"},{"line_number":116,"context_line":"        cached_tracker \u003d version_manager.CachedResourceConsumerTracker()"},{"line_number":117,"context_line":"        self._set_consumer_versions_callback(cached_tracker)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_ff972c38","line":115,"in_reply_to":"5a5ae5dd_ef7a4476","updated":"2016-02-09 09:02:08.000000000","message":"Yeah, we should. I will make a follow up on this one to amend the comments in this file.\n\nThanks Ihar!","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"aff006129a888072be7d5ac50167e66b21e56a71","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        self.assertNotEqual(initial_versions, final_versions)"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def test_update_versions(self):"},{"line_number":116,"context_line":"        cached_tracker \u003d version_manager.CachedResourceConsumerTracker()"},{"line_number":117,"context_line":"        self._set_consumer_versions_callback(cached_tracker)"},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a5ae5dd_4193ff4f","line":115,"in_reply_to":"5a5ae5dd_ff972c38","updated":"2016-02-09 10:58:19.000000000","message":"Done","commit_id":"795bcc328b1825ca3d036fcaf757bb8969a570a9"}],"neutron/tests/unit/api/rpc/handlers/test_resources_rpc.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import testtools"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from neutron.api.rpc.callbacks import resources"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from neutron.api.rpc.callbacks import version_manager"},{"line_number":26,"context_line":"from neutron.api.rpc.handlers import resources_rpc"},{"line_number":27,"context_line":"from neutron.common import topics"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_681537e3","line":24,"updated":"2016-02-05 17:25:59.000000000","message":"remove this empty line.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"070cb119a92f37f41bd97e092aeda0a682efe40c","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    @mock.patch.object(resources_rpc, \u0027_validate_resource_type\u0027)"},{"line_number":100,"context_line":"    def test_resource_type_versioned_topic(self, validate_mock):"},{"line_number":101,"context_line":"        obj_name \u003d FakeResource.obj_name()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        expected \u003d topics.RESOURCE_TOPIC_PATTERN % {"},{"line_number":104,"context_line":"            \u0027resource_type\u0027: \u0027FakeResource\u0027, \u0027version\u0027: \u00271.0\u0027}"},{"line_number":105,"context_line":"        with mock.patch.object(resources_rpc.resources, \u0027get_resource_cls\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a5ae5dd_2833bfac","line":102,"updated":"2016-02-05 17:25:59.000000000","message":"unrelated, fixing.","commit_id":"9e3491aeeec6f0e153be963878a3481308b9f985"}]}
