)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":254,"context_line":"                                             *args, **kwargs)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        self.resource_tracker \u003d resource_tracker.ResourceTracker(self.host,"},{"line_number":257,"context_line":"                self.driver)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _instance_update(self, context, instance_uuid, **kwargs):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwdI%3D","line":256,"updated":"2012-08-14 16:22:21.000000000","message":"Just out of curiosity: Is there a reason this assignment comes after the call to the superclass\u0027s __init__(), when everything else comes before?","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a824bf08c42106913170a14ce6b7e8a753f6ab65","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":254,"context_line":"                                             *args, **kwargs)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        self.resource_tracker \u003d resource_tracker.ResourceTracker(self.host,"},{"line_number":257,"context_line":"                self.driver)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _instance_update(self, context, instance_uuid, **kwargs):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwS0%3D","line":256,"in_reply_to":"AAAALH%2F%2FwT4%3D","updated":"2012-08-14 17:14:03.000000000","message":"OK, makes sense.","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":254,"context_line":"                                             *args, **kwargs)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        self.resource_tracker \u003d resource_tracker.ResourceTracker(self.host,"},{"line_number":257,"context_line":"                self.driver)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _instance_update(self, context, instance_uuid, **kwargs):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwT4%3D","line":256,"in_reply_to":"AAAALH%2F%2FwdI%3D","updated":"2012-08-14 17:04:33.000000000","message":"I did it that way so self.host would already be set.","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":2790,"context_line":"        resource availability and usage in sync with the underlying hypervisor."},{"line_number":2791,"context_line":""},{"line_number":2792,"context_line":"        :param context: security context"},{"line_number":2793,"context_line":"        :returns: Dictionary. See driver.get_available_resource()"},{"line_number":2794,"context_line":"        \"\"\""},{"line_number":2795,"context_line":"        self.resource_tracker.update_available_resource(context)"},{"line_number":2796,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2Fwcs%3D","line":2793,"updated":"2012-08-14 16:22:21.000000000","message":"As a point of information, this method returns nothing; should probably delete the :returns: from the docstring.  Femtonit.","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":2790,"context_line":"        resource availability and usage in sync with the underlying hypervisor."},{"line_number":2791,"context_line":""},{"line_number":2792,"context_line":"        :param context: security context"},{"line_number":2793,"context_line":"        :returns: Dictionary. See driver.get_available_resource()"},{"line_number":2794,"context_line":"        \"\"\""},{"line_number":2795,"context_line":"        self.resource_tracker.update_available_resource(context)"},{"line_number":2796,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwT0%3D","line":2793,"in_reply_to":"AAAALH%2F%2Fwcs%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":280,"context_line":"                                             *args, **kwargs)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        self.resource_tracker \u003d resource_tracker.ResourceTracker(self.host,"},{"line_number":283,"context_line":"                self.driver)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _instance_update(self, context, instance_uuid, **kwargs):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2Frw4%3D","line":282,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: I remember you once answered a question of mine about why this assignment is after the super.  It\u0027d be handy if you could add a comment explaining the rationale as well…","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":2918,"context_line":"    def update_available_resource(self, context):"},{"line_number":2919,"context_line":"        \"\"\"See driver.get_available_resource()"},{"line_number":2920,"context_line":""},{"line_number":2921,"context_line":"        Periodic process that keeps that the compute host\u0027s understanding of"},{"line_number":2922,"context_line":"        resource availability and usage in sync with the underlying hypervisor."},{"line_number":2923,"context_line":""},{"line_number":2924,"context_line":"        :param context: security context"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2Frws%3D","line":2921,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: \"that keeps that the\", should read \"that keeps the\"","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2531967d3d094bcc9fff331bf6ffcf0804298714","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # default to total memory:"},{"line_number":196,"context_line":"            memory_mb_limit \u003d self.compute_node[\u0027memory_mb\u0027]"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        free_ram_mb \u003d memory_mb_limit - self.compute_node[\u0027memory_mb_used\u0027]"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if memory_mb \u003e free_ram_mb:"},{"line_number":201,"context_line":"            LOG.debug(_(\"Unable to claim resources.  Insufficient free \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAKX%2F%2F%2Bbs%3D","line":198,"updated":"2012-07-10 20:33:28.000000000","message":"looks like self.compute_node can be None if this was called via begin_resource_claim() (vs begin_instance_resource_claim).  Since self.compute_node came from outside of the lock on this method... It seems like this method should pull in the record so it\u0027s ensured to be accurate?","commit_id":"193f696dc835953942ef1deaf7fa947ce007f6eb"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"5b5ca72728e5894012e3badd0450ef82d69c8b8a","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # default to total memory:"},{"line_number":196,"context_line":"            memory_mb_limit \u003d self.compute_node[\u0027memory_mb\u0027]"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        free_ram_mb \u003d memory_mb_limit - self.compute_node[\u0027memory_mb_used\u0027]"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if memory_mb \u003e free_ram_mb:"},{"line_number":201,"context_line":"            LOG.debug(_(\"Unable to claim resources.  Insufficient free \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAKX%2F%2F%2BWY%3D","line":198,"in_reply_to":"AAAAKX%2F%2F%2BYo%3D","updated":"2012-07-10 21:39:02.000000000","message":"Ah ok.  The 2nd thing I pointed out, though, is that self.compute_node could be stale, anyway, even if you have it here.  Shouldn\u0027t we pull the latest data in here while we\u0027re locked?  Else you\u0027re potentially updating stale data and saving it at the end of this method.","commit_id":"193f696dc835953942ef1deaf7fa947ce007f6eb"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"4a009cebc16d9cbdc9c17da5a27a3f6e95ab6082","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            # default to total memory:"},{"line_number":196,"context_line":"            memory_mb_limit \u003d self.compute_node[\u0027memory_mb\u0027]"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        free_ram_mb \u003d memory_mb_limit - self.compute_node[\u0027memory_mb_used\u0027]"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if memory_mb \u003e free_ram_mb:"},{"line_number":201,"context_line":"            LOG.debug(_(\"Unable to claim resources.  Insufficient free \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAKX%2F%2F%2BYo%3D","line":198,"in_reply_to":"AAAAKX%2F%2F%2Bbs%3D","updated":"2012-07-10 21:21:38.000000000","message":"update_available_resource() is called when the Service initially starts before any messages are consumed, so self.compute_node will not be None unless the underlying virt driver doesn\u0027t support the resource polling.  If that is the case, then the \"self.disabled()\" check above serves to make sure that resource checking is disabled for the entire compute node.","commit_id":"193f696dc835953942ef1deaf7fa947ce007f6eb"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"2531967d3d094bcc9fff331bf6ffcf0804298714","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        # Apply resource claims representing in-progress operations to"},{"line_number":303,"context_line":"        # \u0027resources\u0027. This may over-estimate the amount of resources in use,"},{"line_number":304,"context_line":"        # at least until the next time \u0027update_available_resource\u0027 runs."},{"line_number":305,"context_line":"        self._apply_claims(resources)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        # also generate all load stats:"},{"line_number":308,"context_line":"        values \u003d self._create_load_stats(context)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAKX%2F%2F%2Bbc%3D","line":305,"updated":"2012-07-10 20:33:28.000000000","message":"Ah, I see.  So there\u0027s an extremely small window (i guess it depends on driver -- in the case of xen, it\u0027ll be an extremely short window) where we could double count resources.  I think this is a good trade-off vs further complicated locking.","commit_id":"193f696dc835953942ef1deaf7fa947ce007f6eb"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"4a009cebc16d9cbdc9c17da5a27a3f6e95ab6082","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        # Apply resource claims representing in-progress operations to"},{"line_number":303,"context_line":"        # \u0027resources\u0027. This may over-estimate the amount of resources in use,"},{"line_number":304,"context_line":"        # at least until the next time \u0027update_available_resource\u0027 runs."},{"line_number":305,"context_line":"        self._apply_claims(resources)"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"        # also generate all load stats:"},{"line_number":308,"context_line":"        values \u003d self._create_load_stats(context)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAKX%2F%2F%2BYk%3D","line":305,"in_reply_to":"AAAAKX%2F%2F%2Bbc%3D","updated":"2012-07-10 21:21:38.000000000","message":"Yes, the resources are potentially double counted if:\n\n1) resources are claimed\n\n2) the compute operation starts using them at the virt layer (i.e. building vms/disks)\n\n3) audit runs before the resource claim can be \"finished\"\n\nThe double counting will resolve itself when the \"finish\" gets called or a subsequent audit runs.\n\nThis pre-claiming of resources is to allow for a \"fail fast\" scenario if scheduler attempts to schedule to an oversubscribed compute node.","commit_id":"193f696dc835953942ef1deaf7fa947ce007f6eb"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"c7853fe88df25eff0bfe359e9e4e0d88c91e089b","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        return claim"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":154,"context_line":"    def begin_resource_claim(self, context, memory_mb, disk_gb,"},{"line_number":155,"context_line":"        memory_mb_limit\u003dNone, timeout\u003dNone, *args, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Indicate that some resources are needed for an upcoming compute"},{"line_number":157,"context_line":"        host operation."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3Zw%3D","line":154,"updated":"2012-08-06 22:52:29.000000000","message":"Why not just call the underlying implementation directly? I don\u0027t see any inheritance going on here, and no real reason the synchronization couldn\u0027t happen on the child method. Do we immediately expect to override this with a child implementation?","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"729056806532f7efb9645d92679d2c31f277a70e","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        return claim"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":154,"context_line":"    def begin_resource_claim(self, context, memory_mb, disk_gb,"},{"line_number":155,"context_line":"        memory_mb_limit\u003dNone, timeout\u003dNone, *args, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Indicate that some resources are needed for an upcoming compute"},{"line_number":157,"context_line":"        host operation."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F1rI%3D","line":154,"in_reply_to":"AAAALH%2F%2F25g%3D","updated":"2012-08-08 16:08:05.000000000","message":"I found that you get deadlock if you do:\n\n@utils.synchronized(\"mylock\")\ndef foo():\n  bar()\n\n@utils.synchronized(\"mylock\")\ndef bar():\n  pass\n\nI can try to clarify the docstring.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"90c5290f140d3097deba1705eb063c2df304315f","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        return claim"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":154,"context_line":"    def begin_resource_claim(self, context, memory_mb, disk_gb,"},{"line_number":155,"context_line":"        memory_mb_limit\u003dNone, timeout\u003dNone, *args, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Indicate that some resources are needed for an upcoming compute"},{"line_number":157,"context_line":"        host operation."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F25g%3D","line":154,"in_reply_to":"AAAALH%2F%2F3WM%3D","updated":"2012-08-07 14:11:58.000000000","message":"That\u0027s a confusing way of putting it because no matter what the underlying method is part of a lock, but looks like the gist is _do_begin_resource_claim needs to be called by begin_resource_claim and begin_instance_resource_claim, both of which are under lock.\n\nAlso, _do_begin_resource_claim has the comment \"\"\"Same as \u0027begin_resource_claim\u0027, but under lock.\"\"\" which seems inaccurate, since everywhere it\u0027s called is under lock.\n\nStill seems a little awkward to me, but I can pass on it.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"ad681ef7b483f71ddd996f6a7dfa6ed433b8f873","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        return claim"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    @utils.synchronized(COMPUTE_RESOURCE_SEMAPHORE)"},{"line_number":154,"context_line":"    def begin_resource_claim(self, context, memory_mb, disk_gb,"},{"line_number":155,"context_line":"        memory_mb_limit\u003dNone, timeout\u003dNone, *args, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Indicate that some resources are needed for an upcoming compute"},{"line_number":157,"context_line":"        host operation."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3WM%3D","line":154,"in_reply_to":"AAAALH%2F%2F3Zw%3D","updated":"2012-08-06 23:08:24.000000000","message":"This one has a decorator.  The underscored version does not.. and the underscored version is used in the method above where you don\u0027t want the decorator either... so it has to be broken out like this.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"c8b5c72bd77fb3858198c0337b4c05dd421d3c24","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova import utils"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"resource_tracker_opts \u003d ["},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027claim_timeout_seconds\u0027, default\u003d120,"},{"line_number":34,"context_line":"               help\u003d\u0027How long, in seconds, before a resource claim times out\u0027),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027compute_stats_class\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027nova.compute.stats.Stats\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALH%2F%2F0UQ%3D","line":33,"updated":"2012-08-09 22:23:29.000000000","message":"I suspect a lot of builds could take longer than 2 minutes.. especially for larger images and larger instance_types that we have to resize.   Do I read the code correctly that a claim would time out in this case?  What\u0027s the consequences of that?","commit_id":"b5813fd1fcb077c2fcd62921ac84a259069b5f2b"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"8d6a81649f9f70aa8291575ec3ced4201b6af439","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova import utils"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"resource_tracker_opts \u003d ["},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027claim_timeout_seconds\u0027, default\u003d120,"},{"line_number":34,"context_line":"               help\u003d\u0027How long, in seconds, before a resource claim times out\u0027),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027compute_stats_class\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027nova.compute.stats.Stats\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALH%2F%2Fzzk%3D","line":33,"in_reply_to":"AAAALH%2F%2F0SI%3D","updated":"2012-08-10 15:25:20.000000000","message":"Done","commit_id":"b5813fd1fcb077c2fcd62921ac84a259069b5f2b"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"a8c0e664950834bcf08c297a5037f5e36489ad92","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova import utils"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"resource_tracker_opts \u003d ["},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027claim_timeout_seconds\u0027, default\u003d120,"},{"line_number":34,"context_line":"               help\u003d\u0027How long, in seconds, before a resource claim times out\u0027),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027compute_stats_class\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027nova.compute.stats.Stats\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALH%2F%2F0SI%3D","line":33,"in_reply_to":"AAAALH%2F%2F0Sk%3D","updated":"2012-08-09 22:59:36.000000000","message":"I\u0027m not a fan of build timeouts like this. We\u0027ll always guess wrong since build times can be so variable. But the better fix is probably a lot more work.\n\nIncreasing it to 10 minutes (at least) is a better idea for now.","commit_id":"b5813fd1fcb077c2fcd62921ac84a259069b5f2b"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"614fc5c6a5478f09493969d30c69f659baf86190","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova import utils"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"resource_tracker_opts \u003d ["},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027claim_timeout_seconds\u0027, default\u003d120,"},{"line_number":34,"context_line":"               help\u003d\u0027How long, in seconds, before a resource claim times out\u0027),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027compute_stats_class\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027nova.compute.stats.Stats\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALH%2F%2F0Sk%3D","line":33,"in_reply_to":"AAAALH%2F%2F0Ts%3D","updated":"2012-08-09 22:55:41.000000000","message":"Makes sense.  I would give it a higher default then.. like 10 minutes.  Some builds can take a while... and it\u0027s better to err on the side of reserving resources than not, I think.","commit_id":"b5813fd1fcb077c2fcd62921ac84a259069b5f2b"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f5f84eba136644fe28386c33e7ce20972aa3d8ee","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from nova import utils"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"resource_tracker_opts \u003d ["},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027claim_timeout_seconds\u0027, default\u003d120,"},{"line_number":34,"context_line":"               help\u003d\u0027How long, in seconds, before a resource claim times out\u0027),"},{"line_number":35,"context_line":"    cfg.StrOpt(\u0027compute_stats_class\u0027,"},{"line_number":36,"context_line":"               default\u003d\u0027nova.compute.stats.Stats\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAALH%2F%2F0Ts%3D","line":33,"in_reply_to":"AAAALH%2F%2F0UQ%3D","updated":"2012-08-09 22:36:55.000000000","message":"The idea here is that when the timeout is expired, the build is assumed to be \"stuck\" and the claim is revoked.  This would result in advertising additional resources to scheduler through compute node.\n\nIf the build is still working normally and just really slow, the potential downside is that a future build will arrive and oversubscribe the local compute host.  This would result in a failure identical to today\u0027s behavior without this patch. (i.e. one of the requests in progress will fail)","commit_id":"b5813fd1fcb077c2fcd62921ac84a259069b5f2b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    ComputeNode model in sync to aid the scheduler in making efficient / more"},{"line_number":52,"context_line":"    correct decisions with respect to host selection."},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":"    def __init__(self, claim_id, memory_mb, disk_gb, timeout, *args, **kwargs):"},{"line_number":55,"context_line":"        self.claim_id \u003d claim_id"},{"line_number":56,"context_line":"        self.memory_mb \u003d memory_mb"},{"line_number":57,"context_line":"        self.disk_gb \u003d disk_gb"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwcY%3D","line":54,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: I\u0027d like a blank line between the end of the docstring and the def __init__().","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    ComputeNode model in sync to aid the scheduler in making efficient / more"},{"line_number":52,"context_line":"    correct decisions with respect to host selection."},{"line_number":53,"context_line":"    \"\"\""},{"line_number":54,"context_line":"    def __init__(self, claim_id, memory_mb, disk_gb, timeout, *args, **kwargs):"},{"line_number":55,"context_line":"        self.claim_id \u003d claim_id"},{"line_number":56,"context_line":"        self.memory_mb \u003d memory_mb"},{"line_number":57,"context_line":"        self.disk_gb \u003d disk_gb"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTs%3D","line":54,"in_reply_to":"AAAALH%2F%2FwcY%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def apply_claim(self, resources):"},{"line_number":62,"context_line":"        \"\"\"Adjust the resources required from available resources."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            :param resources: Should be a dictionary-like object that"},{"line_number":65,"context_line":"                                  has fields like a compute node"},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        return self._apply(resources)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2Fwbw%3D","line":64,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: The :param: should be aligned with the triple-quote, i.e.:\n\n    \"\"\"Adjust the resources required from available resources.\n\n    :param resources: Should be a dictionary-like object that\n                      has fields like a compute node\n    \"\"\"\n\nFor clarity, my previous femtonit about blank line only applies to class-level docstrings.","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def apply_claim(self, resources):"},{"line_number":62,"context_line":"        \"\"\"Adjust the resources required from available resources."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"            :param resources: Should be a dictionary-like object that"},{"line_number":65,"context_line":"                                  has fields like a compute node"},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        return self._apply(resources)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTo%3D","line":64,"in_reply_to":"AAAALH%2F%2Fwbw%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _apply(self, resources, sign\u003d1):"},{"line_number":79,"context_line":"        values \u003d {}"},{"line_number":80,"context_line":"        values[\u0027memory_mb_used\u0027] \u003d resources[\u0027memory_mb_used\u0027] + sign * \\"},{"line_number":81,"context_line":"                                   self.memory_mb"},{"line_number":82,"context_line":"        values[\u0027free_ram_mb\u0027] \u003d resources[\u0027free_ram_mb\u0027] - sign * \\"},{"line_number":83,"context_line":"                                   self.memory_mb"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2Fwbg%3D","line":80,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: I\u0027d personally prefer these expressions be enclosed in parentheses so that you don\u0027t have to use backslash continuation.","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _apply(self, resources, sign\u003d1):"},{"line_number":79,"context_line":"        values \u003d {}"},{"line_number":80,"context_line":"        values[\u0027memory_mb_used\u0027] \u003d resources[\u0027memory_mb_used\u0027] + sign * \\"},{"line_number":81,"context_line":"                                   self.memory_mb"},{"line_number":82,"context_line":"        values[\u0027free_ram_mb\u0027] \u003d resources[\u0027free_ram_mb\u0027] - sign * \\"},{"line_number":83,"context_line":"                                   self.memory_mb"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTk%3D","line":80,"in_reply_to":"AAAALH%2F%2Fwbg%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            LOG.debug(_(\"Claim %d not found.  It either timed out or was \""},{"line_number":260,"context_line":"                        \"already explicitly finished/aborted\"), claim.claim_id)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    def disabled(self):"},{"line_number":263,"context_line":"        return self.compute_node is None"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def free_resources(self, context):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2Fwa0%3D","line":262,"updated":"2012-08-14 16:22:21.000000000","message":"Suggestion: You could make this a property instead of a function; it sorta functions as one already…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            LOG.debug(_(\"Claim %d not found.  It either timed out or was \""},{"line_number":260,"context_line":"                        \"already explicitly finished/aborted\"), claim.claim_id)"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    def disabled(self):"},{"line_number":263,"context_line":"        return self.compute_node is None"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def free_resources(self, context):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTg%3D","line":262,"in_reply_to":"AAAALH%2F%2Fwa0%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":360,"name":"Dan Prince","email":"dprince@redhat.com","username":"dan-prince"},"change_message_id":"4b1fef0fd6b3931ef74ca68b5f1e379ded30525b","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                                   self.memory_mb)"},{"line_number":85,"context_line":"        values[\u0027local_gb_used\u0027] \u003d (resources[\u0027local_gb_used\u0027] + sign *"},{"line_number":86,"context_line":"                                  self.disk_gb)"},{"line_number":87,"context_line":"        values[\u0027free_disk_gb\u0027] \u003d (resources[\u0027free_disk_gb\u0027] - sign *"},{"line_number":88,"context_line":"                                  self.disk_gb)"},{"line_number":89,"context_line":"        return values"},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAALH%2F%2Fs1M%3D","line":87,"updated":"2012-08-17 18:31:23.000000000","message":"I think the issue is here... on a clean DB install \u0027free_disk_gb\u0027 will be 0.\n\n0 -1 * 2 \u003d -2... what I\u0027m seeing.","commit_id":"e6abf6fad0ae0ffbffe74e5a1566d5b82bf11f26"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":175,"context_line":"        :returns: An integer \u0027claim ticket\u0027.  This should be turned into"},{"line_number":176,"context_line":"                  finalize  a resource claim or free resources after the"},{"line_number":177,"context_line":"                  compute operation is finished. Returns None if the claim"},{"line_number":178,"context_line":"                  failed."},{"line_number":179,"context_line":"        \"\"\""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"        return self._do_begin_resource_claim(context, memory_mb, disk_gb,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2Frwg%3D","line":178,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: \"This should be turned in to finalize a resource claim[…]\" (although I\u0027d like greater clarity on what it means to \"turn in\" the \"claim ticket\"—that doesn\u0027t quite fully convey to my mind what exactly is going on here.)  Specific femtonits are \"into\" vs. \"in to\" and the double-space after \"finalize\".","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        self._verify_resources(resources)"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        resources[\u0027free_ram_mb\u0027] \u003d resources[\u0027memory_mb\u0027] - \\"},{"line_number":326,"context_line":"                                   resources[\u0027memory_mb_used\u0027]"},{"line_number":327,"context_line":"        resources[\u0027free_disk_gb\u0027] \u003d resources[\u0027local_gb\u0027] - \\"},{"line_number":328,"context_line":"                                    resources[\u0027local_gb_used\u0027]"},{"line_number":329,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2FrwQ%3D","line":326,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: parentheses so you don\u0027t have to use backslash continuation.","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/compute/stats.py":[{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"c7853fe88df25eff0bfe359e9e4e0d88c91e089b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        key \u003d self._num_vcpus_used_key()"},{"line_number":84,"context_line":"        return int(self.get(key, 0))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_stats_for_instance(self, old_instance, instance):"},{"line_number":87,"context_line":"        \"\"\"Update stats after an instance is changed.\"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        old_vm_state \u003d old_instance[\u0027vm_state\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3Y0%3D","line":86,"updated":"2012-08-06 22:52:29.000000000","message":"At the risk of starting a war, this has some Java-like qualities. I understand the desire to encapsulate the functionality in a class, but it doesn\u0027t really seem like the implementation would change so much that we need to pull out the basic math surrounding an attribute into a separate method. \n\nDo you expect these to change frequently?","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"b77f97dd8444d2a840ced9f5652be302edc78869","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        key \u003d self._num_vcpus_used_key()"},{"line_number":84,"context_line":"        return int(self.get(key, 0))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_stats_for_instance(self, old_instance, instance):"},{"line_number":87,"context_line":"        \"\"\"Update stats after an instance is changed.\"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        old_vm_state \u003d old_instance[\u0027vm_state\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F1i0%3D","line":86,"in_reply_to":"AAAALH%2F%2F1rY%3D","updated":"2012-08-08 17:49:26.000000000","message":"Yeah, I get you. Rephrasing: flexibility is great if we have an immediate need for it or attaining it later will be painful. Otherwise, YAGNI","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"729056806532f7efb9645d92679d2c31f277a70e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        key \u003d self._num_vcpus_used_key()"},{"line_number":84,"context_line":"        return int(self.get(key, 0))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_stats_for_instance(self, old_instance, instance):"},{"line_number":87,"context_line":"        \"\"\"Update stats after an instance is changed.\"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        old_vm_state \u003d old_instance[\u0027vm_state\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F1rY%3D","line":86,"in_reply_to":"AAAALH%2F%2F248%3D","updated":"2012-08-08 16:08:05.000000000","message":"Matt,\n\nThe goal here is getting flexibility to track whatever compute-related stats are relevant to the filters/weights a cloud deployer might care about in their particular implementation.\n\nSome of the particular stats collected here might not be interesting/useful to other deployers.\n\nI\u0027ll look at simplifying this down some.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"90c5290f140d3097deba1705eb063c2df304315f","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        key \u003d self._num_vcpus_used_key()"},{"line_number":84,"context_line":"        return int(self.get(key, 0))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_stats_for_instance(self, old_instance, instance):"},{"line_number":87,"context_line":"        \"\"\"Update stats after an instance is changed.\"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        old_vm_state \u003d old_instance[\u0027vm_state\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F248%3D","line":86,"in_reply_to":"AAAALH%2F%2F3Wg%3D","updated":"2012-08-07 14:11:58.000000000","message":"Sure. All I want to know is if they\u0027ll change frequently. I don\u0027t like to go building things someone might use at some point. I\u0027d be happier if you can see specific use cases now :-)","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"ad681ef7b483f71ddd996f6a7dfa6ed433b8f873","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        key \u003d self._num_vcpus_used_key()"},{"line_number":84,"context_line":"        return int(self.get(key, 0))"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def update_stats_for_instance(self, old_instance, instance):"},{"line_number":87,"context_line":"        \"\"\"Update stats after an instance is changed.\"\"\""},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        old_vm_state \u003d old_instance[\u0027vm_state\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3Wg%3D","line":86,"in_reply_to":"AAAALH%2F%2F3Y0%3D","updated":"2012-08-06 23:08:24.000000000","message":"We have some specific things that we\u0027ll track that I think default trunk will not.  I suspect this could be true for others as well...  This should definitely be pluggable in some way... if that\u0027s what you\u0027re asking.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"c7853fe88df25eff0bfe359e9e4e0d88c91e089b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        key \u003d self._state_stat_key(state, state_type)"},{"line_number":109,"context_line":"        return int(self.get(key, 0))"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _num_instances_key(self):"},{"line_number":112,"context_line":"        return \"num_instances\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _num_instances_for_project_key(self, project_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3Y4%3D","line":111,"updated":"2012-08-06 22:52:29.000000000","message":"These mappings seem kind of awkward to me. Do we really expect the keys to change all that often? Do they really need to be methods on the instance? I kind of feel like these could easily go away, or at worst, replaced with a dictionary that maps \"well-known\" keys to the ones referenced in the dictionary.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"ad681ef7b483f71ddd996f6a7dfa6ed433b8f873","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        key \u003d self._state_stat_key(state, state_type)"},{"line_number":109,"context_line":"        return int(self.get(key, 0))"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _num_instances_key(self):"},{"line_number":112,"context_line":"        return \"num_instances\""},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _num_instances_for_project_key(self, project_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAALH%2F%2F3WY%3D","line":111,"in_reply_to":"AAAALH%2F%2F3Y4%3D","updated":"2012-08-06 23:08:24.000000000","message":"I agree these are kinda overkill.","commit_id":"7888a2ccaa541a1e4f4a1d8fadb46a4e224f6842"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\"Calculate an I/O based load by counting I/O heavy operations\"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        def _get(state, state_type):"},{"line_number":48,"context_line":"            state \u003d state or \"none\""},{"line_number":49,"context_line":"            return self.get(\"num_\" + state_type + \"_\" + state, 0)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        num_builds \u003d _get(vm_states.BUILDING, \"vm\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwaI%3D","line":48,"updated":"2012-08-14 16:22:21.000000000","message":"I don\u0027t understand why you need this clause; everywhere you use _get(), you\u0027re passing a valid value for \"state\", aren\u0027t you?","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \"\"\"Calculate an I/O based load by counting I/O heavy operations\"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        def _get(state, state_type):"},{"line_number":48,"context_line":"            state \u003d state or \"none\""},{"line_number":49,"context_line":"            return self.get(\"num_\" + state_type + \"_\" + state, 0)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        num_builds \u003d _get(vm_states.BUILDING, \"vm\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTY%3D","line":48,"in_reply_to":"AAAALH%2F%2FwaI%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        def _get(state, state_type):"},{"line_number":48,"context_line":"            state \u003d state or \"none\""},{"line_number":49,"context_line":"            return self.get(\"num_\" + state_type + \"_\" + state, 0)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        num_builds \u003d _get(vm_states.BUILDING, \"vm\")"},{"line_number":52,"context_line":"        num_migrations \u003d _get(task_states.RESIZE_MIGRATING, \"task\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwZ8%3D","line":49,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: I\u0027d kinda prefer you use % here, i.e., \u0027\"num_%s_%s\" % (state_type, state)\u0027","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        def _get(state, state_type):"},{"line_number":48,"context_line":"            state \u003d state or \"none\""},{"line_number":49,"context_line":"            return self.get(\"num_\" + state_type + \"_\" + state, 0)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        num_builds \u003d _get(vm_states.BUILDING, \"vm\")"},{"line_number":52,"context_line":"        num_migrations \u003d _get(task_states.RESIZE_MIGRATING, \"task\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTc%3D","line":49,"in_reply_to":"AAAALH%2F%2FwZ8%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        if new_vm_state \u003d\u003d vm_states.DELETED:"},{"line_number":95,"context_line":"            self._decrement(\"num_instances\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"            self._decrement(\"num_os_type_%s\" % old_instance[\u0027os_type\u0027])"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"            self._decrement(\"num_proj_%s\" % old_instance[\"project_id\"])"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwZ0%3D","line":97,"updated":"2012-08-14 16:22:21.000000000","message":"OK, you\u0027re mixing up string building styles in here; please pick one or the other (preferably the % substitution) and stick with it…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        if new_vm_state \u003d\u003d vm_states.DELETED:"},{"line_number":95,"context_line":"            self._decrement(\"num_instances\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"            self._decrement(\"num_os_type_%s\" % old_instance[\u0027os_type\u0027])"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"            self._decrement(\"num_proj_%s\" % old_instance[\"project_id\"])"},{"line_number":100,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTU%3D","line":97,"in_reply_to":"AAAALH%2F%2FwZ0%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        num_backups \u003d _get(task_states.IMAGE_BACKUP, \"task\")"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        return (num_builds + num_rebuilds + num_resizes + num_migrations +"},{"line_number":57,"context_line":"                num_snapshots + num_backups)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def calculate_workload(self):"},{"line_number":60,"context_line":"        \"\"\"Calculate current load of the compute host based on"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2FrwA%3D","line":57,"updated":"2012-08-20 19:43:47.000000000","message":"A suggestion for an alternate approach:\n\n    nums \u003d [\n        _get(vm_states.BUILDING, \"vm\"),\n        _get(task_states.RESIZE_MIGRATING, \"task\"),\n        …\n        ]\n\n    return sum(nums)\n\nThis\u0027ll work fine, however, and may be less opaque.","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":544,"context_line":"    existing \u003d model_query(context, models.ComputeNodeStat, session\u003dsession,"},{"line_number":545,"context_line":"            read_deleted\u003d\"no\").filter_by(compute_node_id\u003dcompute_id).all()"},{"line_number":546,"context_line":"    d \u003d {}"},{"line_number":547,"context_line":"    for s in existing:"},{"line_number":548,"context_line":"        key \u003d s[\u0027key\u0027]"},{"line_number":549,"context_line":"        d[key] \u003d s"},{"line_number":550,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwZc%3D","line":547,"updated":"2012-08-14 16:22:21.000000000","message":"Could you use more descriptive temporary variable names here?  I personally limit my one-character variables to loop counters and comprehensions…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":544,"context_line":"    existing \u003d model_query(context, models.ComputeNodeStat, session\u003dsession,"},{"line_number":545,"context_line":"            read_deleted\u003d\"no\").filter_by(compute_node_id\u003dcompute_id).all()"},{"line_number":546,"context_line":"    d \u003d {}"},{"line_number":547,"context_line":"    for s in existing:"},{"line_number":548,"context_line":"        key \u003d s[\u0027key\u0027]"},{"line_number":549,"context_line":"        d[key] \u003d s"},{"line_number":550,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTM%3D","line":547,"in_reply_to":"AAAALH%2F%2FwZc%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"}],"nova/db/sqlalchemy/models.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"class ComputeNodeStat(BASE, NovaBase):"},{"line_number":167,"context_line":"    \"\"\"Stats related to the current workload of a compute host that are"},{"line_number":168,"context_line":"    intended to aid in making scheduler decisions.\"\"\""},{"line_number":169,"context_line":"    __tablename__ \u003d \u0027compute_node_stats\u0027"},{"line_number":170,"context_line":"    id \u003d Column(Integer, primary_key\u003dTrue)"},{"line_number":171,"context_line":"    key \u003d Column(String(511))"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2Frvk%3D","line":168,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: in this case, the closing triple-quote should be on a line by itself…","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/tests/compute/fake_resource_tracker.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":"from nova.compute import resource_tracker"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class FakeResourceTracker(resource_tracker.ResourceTracker):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwZE%3D","line":17,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: I\u0027d like a blank line between the copyright/license header and the import…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":"from nova.compute import resource_tracker"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"class FakeResourceTracker(resource_tracker.ResourceTracker):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTI%3D","line":17,"in_reply_to":"AAAALH%2F%2FwZE%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"}],"nova/tests/compute/test_resource_tracker.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":"\"\"\"Tests for compute resource tracking\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import copy"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwZA%3D","line":17,"updated":"2012-08-14 16:22:21.000000000","message":"femtonit: Again, I\u0027d like a blank line between the copyright/license header and the docstring…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":"\"\"\"Tests for compute resource tracking\"\"\""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import copy"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTE%3D","line":17,"in_reply_to":"AAAALH%2F%2FwZA%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def testInsufficientMemoryClaim(self):"},{"line_number":262,"context_line":"        \"\"\"Exceed memory limit of 5MB\"\"\""},{"line_number":263,"context_line":"        #raise Exception(self.tracker.compute_node)"},{"line_number":264,"context_line":"        claim \u003d self.tracker.begin_resource_claim(self.context, memory_mb\u003d2,"},{"line_number":265,"context_line":"                disk_gb\u003d0)"},{"line_number":266,"context_line":"        self.assertNotEqual(None, claim)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwY4%3D","line":263,"updated":"2012-08-14 16:22:21.000000000","message":"Debugging code left in?","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"32768592f46f1e746958710c0e8d8d5069848bfe","unresolved":false,"context_lines":[{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def testInsufficientMemoryClaim(self):"},{"line_number":262,"context_line":"        \"\"\"Exceed memory limit of 5MB\"\"\""},{"line_number":263,"context_line":"        #raise Exception(self.tracker.compute_node)"},{"line_number":264,"context_line":"        claim \u003d self.tracker.begin_resource_claim(self.context, memory_mb\u003d2,"},{"line_number":265,"context_line":"                disk_gb\u003d0)"},{"line_number":266,"context_line":"        self.assertNotEqual(None, claim)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwSI%3D","line":263,"in_reply_to":"AAAALH%2F%2FwY4%3D","updated":"2012-08-14 17:16:06.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        # seed tracker with data:"},{"line_number":151,"context_line":"        self.tracker.update_available_resource(self.context)"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def testDisabled(self):"},{"line_number":154,"context_line":"        # disabled \u003d no compute node stats"},{"line_number":155,"context_line":"        self.assertTrue(self.tracker.disabled)"},{"line_number":156,"context_line":"        self.assertEqual(None, self.tracker.compute_node)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2FrvI%3D","line":153,"updated":"2012-08-20 19:43:47.000000000","message":"In general, we prefer function names to be snake-case, including for tests.  (The setUp() and tearDown() functions have to be camel-case since they\u0027re called by the test framework.)","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self.tracker \u003d self._tracker()"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def testMissingService(self):"},{"line_number":202,"context_line":"        \"\"\"No service record in DB.\"\"\""},{"line_number":203,"context_line":"        self.tracker.update_available_resource(self.context)"},{"line_number":204,"context_line":"        self.assertTrue(self.tracker.disabled)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2FrvM%3D","line":202,"updated":"2012-08-20 19:43:47.000000000","message":"femtonit: having a docstring here will cause the test to be identified as \"No service record in DB.\" instead of with the test name (\"nova.tests.compute.test_resource_tracker.MissingServiceTestCase.testMissingService\"); generally, avoiding the use of docstrings seems to be best for figuring out where a failing test is when it later needs to be updated.","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/tests/compute/test_stats.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"2bfa7550449afe52416edca2fcbc839f814ad924","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            instance.update(values)"},{"line_number":43,"context_line":"        return instance"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def testOsTypeCount(self):"},{"line_number":46,"context_line":"        os_type \u003d \"Linux\""},{"line_number":47,"context_line":"        self.assertEqual(0, self.stats.num_os_type(os_type))"},{"line_number":48,"context_line":"        self.stats._increment(\"num_os_type_\" + os_type)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAALH%2F%2FrvE%3D","line":45,"updated":"2012-08-20 19:43:47.000000000","message":"In general, we prefer function names to be snake-case, including for tests.  (The setUp() and tearDown() functions have to be camel-case since they\u0027re called by the test framework.)","commit_id":"c7d812a35bf4ef42907366c3f674fd623cd46905"}],"nova/virt/xenapi/driver.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aab29fbe1d5d78f631b081c44adbe637b0d84841","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        # NOTE(belliott) memory-free-computed is a value provided by XenServer"},{"line_number":386,"context_line":"        # for gauging free memory more conservatively than memory-free."},{"line_number":387,"context_line":"        free_ram_mb \u003d host_stats[\u0027host_memory_free_computed\u0027] / (1024 * 1024)"},{"line_number":388,"context_line":"        #free_ram_mb \u003d host_stats[\u0027host_memory_free\u0027] / (1024 * 1024)"},{"line_number":389,"context_line":"        total_disk_gb \u003d host_stats[\u0027disk_total\u0027] / (1024 * 1024 * 1024)"},{"line_number":390,"context_line":"        used_disk_gb \u003d host_stats[\u0027disk_used\u0027] / (1024 * 1024 * 1024)"},{"line_number":391,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwXw%3D","line":388,"updated":"2012-08-14 16:22:21.000000000","message":"I\u0027d prefer that we remove commented-out code rather than leave it around.  I suppose we could make an exception for this one, but if we do, please group it with the comment explaining memory-free-computed…","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"f36d2b09b05892b9032020cf4c8082b69eacb1ff","unresolved":false,"context_lines":[{"line_number":385,"context_line":"        # NOTE(belliott) memory-free-computed is a value provided by XenServer"},{"line_number":386,"context_line":"        # for gauging free memory more conservatively than memory-free."},{"line_number":387,"context_line":"        free_ram_mb \u003d host_stats[\u0027host_memory_free_computed\u0027] / (1024 * 1024)"},{"line_number":388,"context_line":"        #free_ram_mb \u003d host_stats[\u0027host_memory_free\u0027] / (1024 * 1024)"},{"line_number":389,"context_line":"        total_disk_gb \u003d host_stats[\u0027disk_total\u0027] / (1024 * 1024 * 1024)"},{"line_number":390,"context_line":"        used_disk_gb \u003d host_stats[\u0027disk_used\u0027] / (1024 * 1024 * 1024)"},{"line_number":391,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAALH%2F%2FwTA%3D","line":388,"in_reply_to":"AAAALH%2F%2FwXw%3D","updated":"2012-08-14 17:04:33.000000000","message":"Done","commit_id":"8e48c94e3f38839e0464c86e5a2aa7d57e80a281"}]}
