)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"cfcf0500_0442f4f5","updated":"2025-07-16 12:27:55.000000000","message":"Thanks for working on this. I have couple of suggestions inline.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"}],"nova/context.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":true,"context_lines":[{"line_number":413,"context_line":"        if time.monotonic() \u003e self.deadline:"},{"line_number":414,"context_line":"            raise exception.CellTimeout()"},{"line_number":415,"context_line":"        else:"},{"line_number":416,"context_line":"            return max(0, self.deadline - time.monotonic())"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _task(self, fn, *args, **kwargs):"},{"line_number":419,"context_line":"        # This runs inside the thread. It runs the target function and adds"}],"source_content_type":"text/x-python","patch_set":1,"id":"47e74d23_ec83c181","line":416,"updated":"2025-07-16 12:27:55.000000000","message":"the meaning of queue.put(item, block\u003dTrue, timeout\u003d0) is not clear to me from the doc:\n```\n If timeout is a positive number, it blocks at most timeout seconds and raises the Full exception if no free slot was available within that time.\n```\nhttps://docs.python.org/3/library/queue.html#queue.Queue.put\n\nBut in my trial 0 means basically non blocking even if block is set to True. So I guess this is OK.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd1a83a19504a9bf7e823426f444808222ac6431","unresolved":false,"context_lines":[{"line_number":413,"context_line":"        if time.monotonic() \u003e self.deadline:"},{"line_number":414,"context_line":"            raise exception.CellTimeout()"},{"line_number":415,"context_line":"        else:"},{"line_number":416,"context_line":"            return max(0, self.deadline - time.monotonic())"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def _task(self, fn, *args, **kwargs):"},{"line_number":419,"context_line":"        # This runs inside the thread. It runs the target function and adds"}],"source_content_type":"text/x-python","patch_set":1,"id":"15dc6953_ae55a10f","line":416,"in_reply_to":"47e74d23_ec83c181","updated":"2025-07-16 13:34:57.000000000","message":"Acknowledged","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":true,"context_lines":[{"line_number":426,"context_line":"                self.was_generator \u003d True"},{"line_number":427,"context_line":"                for item in result:"},{"line_number":428,"context_line":"                    self.result_q.put(item, timeout\u003dself.remaining)"},{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"}],"source_content_type":"text/x-python","patch_set":1,"id":"44e5d872_86d8e25a","line":429,"updated":"2025-07-16 12:27:55.000000000","message":"Can we use https://docs.python.org/3/library/queue.html#queue.Queue.shutdown to cover the stopping early scenario?","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d73881f1cf010c7f2b7b4b24c8a4195fb13a5b75","unresolved":true,"context_lines":[{"line_number":426,"context_line":"                self.was_generator \u003d True"},{"line_number":427,"context_line":"                for item in result:"},{"line_number":428,"context_line":"                    self.result_q.put(item, timeout\u003dself.remaining)"},{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"}],"source_content_type":"text/x-python","patch_set":1,"id":"79eaba89_8f8a4f85","line":429,"in_reply_to":"3fe31376_71ff08c1","updated":"2025-07-16 14:06:14.000000000","message":"Ah, no we can\u0027t:\n\u003e Added in version 3.13.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd1a83a19504a9bf7e823426f444808222ac6431","unresolved":true,"context_lines":[{"line_number":426,"context_line":"                self.was_generator \u003d True"},{"line_number":427,"context_line":"                for item in result:"},{"line_number":428,"context_line":"                    self.result_q.put(item, timeout\u003dself.remaining)"},{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fe31376_71ff08c1","line":429,"in_reply_to":"44e5d872_86d8e25a","updated":"2025-07-16 13:34:57.000000000","message":"Sure","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f8d6e6bc73c5c98c9fbca5b56470c9f624b873c2","unresolved":false,"context_lines":[{"line_number":426,"context_line":"                self.was_generator \u003d True"},{"line_number":427,"context_line":"                for item in result:"},{"line_number":428,"context_line":"                    self.result_q.put(item, timeout\u003dself.remaining)"},{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"}],"source_content_type":"text/x-python","patch_set":1,"id":"d13d246d_dcf2a6a6","line":429,"in_reply_to":"79eaba89_8f8a4f85","updated":"2025-09-09 19:38:32.000000000","message":"Acknowledged","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":true,"context_lines":[{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"},{"line_number":433,"context_line":"        except Exception as e:"},{"line_number":434,"context_line":"            # Only log the exception traceback for non-nova exceptions."},{"line_number":435,"context_line":"            if not isinstance(e, exception.NovaException):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7d7496c3_9c2ee926","line":432,"updated":"2025-07-16 12:27:55.000000000","message":"as here we have a single item to put to the queue during the whole task, and the queue size is at least 1, Queue(maxsize\u003d0) means unlimited, this put() always succeeds. So timeout\u003dself.remaining here is noop, but we can keep it for symmetry.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd1a83a19504a9bf7e823426f444808222ac6431","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    if not self.running:"},{"line_number":430,"context_line":"                        break"},{"line_number":431,"context_line":"            else:"},{"line_number":432,"context_line":"                self.result_q.put(result, timeout\u003dself.remaining)"},{"line_number":433,"context_line":"        except Exception as e:"},{"line_number":434,"context_line":"            # Only log the exception traceback for non-nova exceptions."},{"line_number":435,"context_line":"            if not isinstance(e, exception.NovaException):"}],"source_content_type":"text/x-python","patch_set":1,"id":"27397140_0dd2424a","line":432,"in_reply_to":"7d7496c3_9c2ee926","updated":"2025-07-16 13:34:57.000000000","message":"Acknowledged","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":true,"context_lines":[{"line_number":434,"context_line":"            # Only log the exception traceback for non-nova exceptions."},{"line_number":435,"context_line":"            if not isinstance(e, exception.NovaException):"},{"line_number":436,"context_line":"                LOG.exception(\u0027Error gathering result from cell %s\u0027, self.cell_uuid)"},{"line_number":437,"context_line":"            return e"},{"line_number":438,"context_line":"        finally:"},{"line_number":439,"context_line":"            self.running \u003d False"},{"line_number":440,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"6b8efdaa_2a58e78e","line":437,"updated":"2025-07-16 12:27:55.000000000","message":"this worth a note that normal result is travelling via the queue while exception is travelling as the result of the future.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f8d6e6bc73c5c98c9fbca5b56470c9f624b873c2","unresolved":false,"context_lines":[{"line_number":434,"context_line":"            # Only log the exception traceback for non-nova exceptions."},{"line_number":435,"context_line":"            if not isinstance(e, exception.NovaException):"},{"line_number":436,"context_line":"                LOG.exception(\u0027Error gathering result from cell %s\u0027, self.cell_uuid)"},{"line_number":437,"context_line":"            return e"},{"line_number":438,"context_line":"        finally:"},{"line_number":439,"context_line":"            self.running \u003d False"},{"line_number":440,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fcb0fbd9_9a3e6145","line":437,"in_reply_to":"3320286c_dd9da8d4","updated":"2025-09-09 19:38:32.000000000","message":"Done","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd1a83a19504a9bf7e823426f444808222ac6431","unresolved":true,"context_lines":[{"line_number":434,"context_line":"            # Only log the exception traceback for non-nova exceptions."},{"line_number":435,"context_line":"            if not isinstance(e, exception.NovaException):"},{"line_number":436,"context_line":"                LOG.exception(\u0027Error gathering result from cell %s\u0027, self.cell_uuid)"},{"line_number":437,"context_line":"            return e"},{"line_number":438,"context_line":"        finally:"},{"line_number":439,"context_line":"            self.running \u003d False"},{"line_number":440,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3320286c_dd9da8d4","line":437,"in_reply_to":"6b8efdaa_2a58e78e","updated":"2025-07-16 13:34:57.000000000","message":"Mentioned on L451 but sure","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edd09a783947daba6d41c80afa56fe9ed223af77","unresolved":true,"context_lines":[{"line_number":454,"context_line":""},{"line_number":455,"context_line":"        results \u003d list(self)"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        if self.was_generator:"},{"line_number":458,"context_line":"            return results"},{"line_number":459,"context_line":"        else:"},{"line_number":460,"context_line":"            # This should never not have an item as we always queue the result of"}],"source_content_type":"text/x-python","patch_set":1,"id":"b8a7ab34_f62c8607","line":457,"updated":"2025-07-16 12:27:55.000000000","message":"This discriminator bothers me. It feels like we are smashing two separate implementations of the same interface together. Maybe (I\u0027m not sure) the two separate SGContext implementation would be clearer. LIke the non generator one would not even need a queue as far as I see.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd1a83a19504a9bf7e823426f444808222ac6431","unresolved":true,"context_lines":[{"line_number":454,"context_line":""},{"line_number":455,"context_line":"        results \u003d list(self)"},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        if self.was_generator:"},{"line_number":458,"context_line":"            return results"},{"line_number":459,"context_line":"        else:"},{"line_number":460,"context_line":"            # This should never not have an item as we always queue the result of"}],"source_content_type":"text/x-python","patch_set":1,"id":"032e2fb9_b147d7cc","line":457,"in_reply_to":"b8a7ab34_f62c8607","updated":"2025-07-16 13:34:57.000000000","message":"The problem is we don\u0027t know until we run the function. Squashing two behaviors into a single predicable wrapper was the goal here. I don\u0027t see how we could have two separate implementations unless we run the function before we even create this. We could do that but it pushes more of this back into the double-nested caller which was already pretty confusing. To me, this simplifies the s-g behavior quite a bit, but the bigger win is in the second patch I have queued, this allows you to call s-g without it waiting on the results, and just return these wrapper objects to the caller to do their own consumption and waiting. That will allow `multi_cell_list` to pull results in parallel, but I think we need a solid interface to return if we make that external to s-g like that.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d73881f1cf010c7f2b7b4b24c8a4195fb13a5b75","unresolved":true,"context_lines":[{"line_number":511,"context_line":"            tasks[cell_mapping.uuid] \u003d sg_ctx"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    if nowait:"},{"line_number":514,"context_line":"        return tasks"},{"line_number":515,"context_line":""},{"line_number":516,"context_line":"    futurist.waiters.wait_for_all("},{"line_number":517,"context_line":"        [task.task_future for task in tasks.values()], timeout)"}],"source_content_type":"text/x-python","patch_set":1,"id":"82ea0d62_d899a65d","line":514,"updated":"2025-07-16 14:06:14.000000000","message":"This leaked from the next patch, but it\u0027s a reference to what I\u0027m mentioning above.","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f8d6e6bc73c5c98c9fbca5b56470c9f624b873c2","unresolved":false,"context_lines":[{"line_number":511,"context_line":"            tasks[cell_mapping.uuid] \u003d sg_ctx"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    if nowait:"},{"line_number":514,"context_line":"        return tasks"},{"line_number":515,"context_line":""},{"line_number":516,"context_line":"    futurist.waiters.wait_for_all("},{"line_number":517,"context_line":"        [task.task_future for task in tasks.values()], timeout)"}],"source_content_type":"text/x-python","patch_set":1,"id":"bcb9a694_8df1cc16","line":514,"in_reply_to":"82ea0d62_d899a65d","updated":"2025-09-09 19:38:32.000000000","message":"Acknowledged","commit_id":"0f877b7ebf437225b1f4b54138f4d4f1bdcdf12c"}]}
