)]}'
{"taskflow/conductors/backends/impl_blocking.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"3cc525a5ba21e312240f0444e3332e68ae497a25","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        try:"},{"line_number":166,"context_line":"            dispatched \u003d 0"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"            if not max_dispatches:"},{"line_number":169,"context_line":"                # NOTE(TheSriram): if max_dispatches is not set,"},{"line_number":170,"context_line":"                # then the  conductor will run indefinitely, and not"},{"line_number":171,"context_line":"                # stop after \u0027n\u0027 number of dispatches"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_704ec997","line":168,"updated":"2015-10-14 17:03:47.000000000","message":"Thoughts on comparing to `None` here directly, since if this is zero, this will then get set to inf when the person calling run might have intended it to be zero (for whatever reason). \n\nAlso probably better to just use negative numbers for running forever, then don\u0027t need to get involved in float comparisons and all that. Thoughts?\n\n  if max_dispatches is None:\n      max_dispatches \u003d -1\n\nAnother idea is u could use a little helper method like this and change this into:\n\n    \u003e\u003e\u003e import itertools\n    \u003e\u003e\u003e import six\n    \u003e\u003e\u003e\n    \u003e\u003e\u003e def _while_or_forever(iterations):\n    ...    it \u003d itertools.count()\n    ...    if iterations \u003c 0:\n    ...       while True:\n    ...           yield six.next(it)\n    ...    else:\n    ...       while True:\n    ...           c \u003d six.next(it)\n    ...           if c \u003c iterations:\n    ...              yield c\n    ...           else:\n    ...              break\n\nThen the loop can be:\n\n  for iteration in _while_or_forever(max_dispatches):\n     ...\n\nAnyways, just an idea.","commit_id":"0693c18230a7c1dd6d4dd6f6b771008e7e36a831"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"3cc525a5ba21e312240f0444e3332e68ae497a25","unresolved":false,"context_lines":[{"line_number":212,"context_line":""},{"line_number":213,"context_line":"            if max_dispatches !\u003d float(\"inf\"):"},{"line_number":214,"context_line":"                msg \u003d \"Maximum Dispatch \" \\"},{"line_number":215,"context_line":"                      \"limit of {0} reached\".format(max_dispatches)"},{"line_number":216,"context_line":"                LOG.warn(msg)"},{"line_number":217,"context_line":"                self.stop()"},{"line_number":218,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_1013d567","line":215,"updated":"2015-10-14 17:03:47.000000000","message":"Suggestion, just use:\n\n  LOG.warn(\"Maximum Dispatch limit of %s reached\", max_dispatches)\n\nThe above way of calling avoids interpolating the integer into the string if the log level is less than warning, which is a good pattern to follow.","commit_id":"0693c18230a7c1dd6d4dd6f6b771008e7e36a831"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"ea31d0f4d4adb38790eddc98a23005550c6da5df","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                            LOG.warn(\"Failed job abandonment: %s\", job,"},{"line_number":208,"context_line":"                                     exc_info\u003dTrue)"},{"line_number":209,"context_line":"                if dispatched \u003d\u003d 0 and not self._wait_timeout.is_stopped():"},{"line_number":210,"context_line":"                    self._wait_timeout.wait()"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            if dispatched \u003d\u003d max_dispatches:"},{"line_number":213,"context_line":"                LOG.warn(\"Maximum dispatch Limit of %s reached\","}],"source_content_type":"text/x-python","patch_set":3,"id":"5a2ca52d_9496ef4a","line":210,"updated":"2015-10-14 21:25:40.000000000","message":"So can u have a local_dispatched\u003d0 and use that here, the reason for having dispatched in the loop was so that if no jobs were dispatched that at that point we wait until further iterations. With the change made here to move dispatched to be a function variable it now will not wait anymore if at least one job has dispatched previously :(","commit_id":"f5edd62b6594220e60f267e8ec0b9964b23b1e8f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"d4a01f10c1eecbb55ec64be4018d118f09b24107","unresolved":false,"context_lines":[{"line_number":210,"context_line":"                    self._wait_timeout.wait()"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            if dispatched \u003d\u003d max_dispatches:"},{"line_number":213,"context_line":"                LOG.warn(\"Maximum dispatch Limit of %s reached\","},{"line_number":214,"context_line":"                         max_dispatches)"},{"line_number":215,"context_line":"                self.stop()"},{"line_number":216,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a2ca52d_f485e306","line":213,"updated":"2015-10-14 21:26:11.000000000","message":"nit, \u0027Maximum dispatch Limit\u0027 -\u003e \u0027Maximum dispatch limit\u0027 (keeps the case more like what one would expect)","commit_id":"f5edd62b6594220e60f267e8ec0b9964b23b1e8f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"c075cd6d3a1e3b28d91b78cc162f2fd8e4bb9bef","unresolved":false,"context_lines":[{"line_number":210,"context_line":"                    self._wait_timeout.wait()"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"            if dispatched \u003d\u003d max_dispatches:"},{"line_number":213,"context_line":"                LOG.warn(\"Maximum dispatch Limit of %s reached\","},{"line_number":214,"context_line":"                         max_dispatches)"},{"line_number":215,"context_line":"                self.stop()"},{"line_number":216,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a2ca52d_14b73fd9","line":213,"in_reply_to":"5a2ca52d_f485e306","updated":"2015-10-14 21:27:40.000000000","message":"Should this also be a info statement, vs a warning, since warning seems more for errors...\n\nhttps://wiki.openstack.org/wiki/LoggingStandards#INFO_log_level_is_for_Operators\n\nInfo though seems ok for now.","commit_id":"f5edd62b6594220e60f267e8ec0b9964b23b1e8f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"5543265968660a94da1338798e0a7186cacc7673","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    def run(self, max_dispatches\u003dNone):"},{"line_number":163,"context_line":"        self._dead.clear()"},{"line_number":164,"context_line":"        try:"},{"line_number":165,"context_line":"            local_dispatched \u003d 0"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"            if max_dispatches is None:"},{"line_number":168,"context_line":"                # NOTE(TheSriram): if max_dispatches is not set,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_ca0cbc96","line":165,"updated":"2015-10-14 22:26:00.000000000","message":"Ah, probably this one should be named total_dispatches (since its the total), haha, thought u were going to rename the other one :)","commit_id":"b31ea54eb0b91d1fa912f9ae828178342110319e"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"07ff3af25c1bdb0a52049008fe2ab07a8bbe788a","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                # stop after \u0027n\u0027 number of dispatches"},{"line_number":171,"context_line":"                max_dispatches \u003d -1"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"            while True and local_dispatched !\u003d max_dispatches:"},{"line_number":174,"context_line":"                if self._wait_timeout.is_stopped():"},{"line_number":175,"context_line":"                    break"},{"line_number":176,"context_line":"                dispatched \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_8a6ec42d","line":173,"updated":"2015-10-14 22:28:17.000000000","message":"I think u want local_dispatched \u003c max_dispatches\n\nBecause the iteration in the internal iterjobs() loop may actually cause local_dispatched to be \u003e\u003d max_dispatches","commit_id":"b31ea54eb0b91d1fa912f9ae828178342110319e"},{"author":{"_account_id":8092,"name":"Sriram Madapusi Vasudevan","email":"sriram1991mv@gmail.com","username":"thesriram"},"change_message_id":"d4c19044f7813fdd6227dc1c91b13b1701596354","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                # stop after \u0027n\u0027 number of dispatches"},{"line_number":171,"context_line":"                max_dispatches \u003d -1"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"            while True and local_dispatched !\u003d max_dispatches:"},{"line_number":174,"context_line":"                if self._wait_timeout.is_stopped():"},{"line_number":175,"context_line":"                    break"},{"line_number":176,"context_line":"                dispatched \u003d 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_bb9418e2","line":173,"in_reply_to":"5a2ca52d_8a6ec42d","updated":"2015-10-15 13:33:14.000000000","message":"local_dispatched at 0, and max_dispatches\u003d-1 will fail that condition, and the other thing to reference local_dispatched in the while, it needs to be assigned to something, that is why I had it assigned outside the while.","commit_id":"b31ea54eb0b91d1fa912f9ae828178342110319e"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"07ff3af25c1bdb0a52049008fe2ab07a8bbe788a","unresolved":false,"context_lines":[{"line_number":211,"context_line":"                if dispatched \u003d\u003d 0 and not self._wait_timeout.is_stopped():"},{"line_number":212,"context_line":"                    self._wait_timeout.wait()"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"            if local_dispatched \u003d\u003d max_dispatches:"},{"line_number":215,"context_line":"                LOG.info(\"Maximum dispatch limit of %s reached\","},{"line_number":216,"context_line":"                         max_dispatches)"},{"line_number":217,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_8a556451","line":214,"updated":"2015-10-14 22:28:17.000000000","message":"Pretty sure u want `max_dispatches \u003e\u003d 0 and local_dispatched \u003e\u003d max_dispatches` due to how local_dispatches can actually go over max_dispatches due to iterjobs loop.","commit_id":"b31ea54eb0b91d1fa912f9ae828178342110319e"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"a40146a21d0eaa5359929f3451723b235f09d365","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    def run(self, max_dispatches\u003dNone):"},{"line_number":163,"context_line":"        self._dead.clear()"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        def _iter_forever(dispatches):"},{"line_number":166,"context_line":"            if dispatches \u003c 0:"},{"line_number":167,"context_line":"                i \u003d 0"},{"line_number":168,"context_line":"                while True:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_44b95378","line":165,"updated":"2015-10-15 18:22:13.000000000","message":"How about putting this at the module level as a module level private function, so that it isn\u0027t reevaluted everytime run is called.","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"a40146a21d0eaa5359929f3451723b235f09d365","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                    i +\u003d 1"},{"line_number":170,"context_line":"                    yield i"},{"line_number":171,"context_line":"            else:"},{"line_number":172,"context_line":"                for i in range(0, dispatches):"},{"line_number":173,"context_line":"                    yield i"},{"line_number":174,"context_line":"        try:"},{"line_number":175,"context_line":"            total_dispatched \u003d 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_e48bbfc1","line":172,"updated":"2015-10-15 18:22:13.000000000","message":"Can u switch this to be:\n\n\u003e\u003e\u003e from six.moves import range as compat_range\n\u003e\u003e\u003e compat_range\n\u003ctype \u0027xrange\u0027\u003e\n\nThat way on py2.x it doesn\u0027t expand the full range, and then start using it (but does that iteratively instead); saving memory and all that goodness.","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"2cd0f198586e666c67c82374be2fdeda97d59409","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                    else:"},{"line_number":209,"context_line":"                        local_dispatched +\u003d 1"},{"line_number":210,"context_line":"                        try:"},{"line_number":211,"context_line":"                            total_dispatched +\u003d next(dispatch_gen)"},{"line_number":212,"context_line":"                        except StopIteration:"},{"line_number":213,"context_line":"                            max_dispatch_reached.set()"},{"line_number":214,"context_line":"                        consume \u003d f.result()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_c7180578","line":211,"updated":"2015-10-15 18:24:20.000000000","message":"Also I don\u0027t think u need +\u003d here but just\n\n   total_dispatched +\u003d next(dispatch_gen)\n\nSince dispatch_gen is always counting up.","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"bdf0eee1fb82975d069dd1467d855400dd14ca66","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                    else:"},{"line_number":209,"context_line":"                        local_dispatched +\u003d 1"},{"line_number":210,"context_line":"                        try:"},{"line_number":211,"context_line":"                            total_dispatched +\u003d next(dispatch_gen)"},{"line_number":212,"context_line":"                        except StopIteration:"},{"line_number":213,"context_line":"                            max_dispatch_reached.set()"},{"line_number":214,"context_line":"                        consume \u003d f.result()"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_472395a7","line":211,"in_reply_to":"5a2ca52d_c7180578","updated":"2015-10-15 18:24:51.000000000","message":"Oops, should be:\n\n  total_dispatched \u003d next(dispatch_gen)","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"a40146a21d0eaa5359929f3451723b235f09d365","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                        local_dispatched +\u003d 1"},{"line_number":210,"context_line":"                        try:"},{"line_number":211,"context_line":"                            total_dispatched +\u003d next(dispatch_gen)"},{"line_number":212,"context_line":"                        except StopIteration:"},{"line_number":213,"context_line":"                            max_dispatch_reached.set()"},{"line_number":214,"context_line":"                        consume \u003d f.result()"},{"line_number":215,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_644c8f9e","line":212,"updated":"2015-10-15 18:22:13.000000000","message":"Other idea, just have the except StopIteration be in the function level try, finally (the one that sets dead.set), then the inner loop will stop automatically and the outter one will also. Thoughts?","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"641a97c7f73a652d1e32a3e12e7d3d6078b3f00e","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                        local_dispatched +\u003d 1"},{"line_number":210,"context_line":"                        try:"},{"line_number":211,"context_line":"                            total_dispatched +\u003d next(dispatch_gen)"},{"line_number":212,"context_line":"                        except StopIteration:"},{"line_number":213,"context_line":"                            max_dispatch_reached.set()"},{"line_number":214,"context_line":"                        consume \u003d f.result()"},{"line_number":215,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_841f6b6b","line":212,"in_reply_to":"5a2ca52d_644c8f9e","updated":"2015-10-15 18:23:36.000000000","message":"Doing that I think removes the need for max_dispatch_reached event.","commit_id":"8f632eb43f8c3eedd3a50c4cccd5c4fdadf71c5f"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"b474baa3addb6b8f4d56217c4f792f41aaf0494a","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                LOG.info(\"Job completed successfully: %s\", job)"},{"line_number":160,"context_line":"            return async_utils.make_completed_future(consume)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def _iter_forever(self, dispatches):"},{"line_number":163,"context_line":"        if dispatches \u003c 0:"},{"line_number":164,"context_line":"            i \u003d 0"},{"line_number":165,"context_line":"            while True:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a2ca52d_a7c62966","line":162,"updated":"2015-10-15 18:35:24.000000000","message":"@staticmethod on this, since it doesn\u0027t need access to self :)","commit_id":"bbce8f99e669772a6683a8ff26a5b38143a13ebd"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"1d9e08d1f96026bf02988bde014747c04ab208f6","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                    else:"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"                        local_dispatched +\u003d 1"},{"line_number":201,"context_line":"                        total_dispatched \u003d next(dispatch_gen)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"                        consume \u003d f.result()"},{"line_number":204,"context_line":"                    try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a2ca52d_f87e0018","line":201,"updated":"2015-10-15 19:52:38.000000000","message":"Sooo if this raises stop iteration at this point the job will be left not consumed/not abandoned right, that seems sorta bad (seeing as the job did get processed); perhaps do this before after consume/abandon?","commit_id":"13d308b3326b683b75febcff04c8877eeb6347b9"}],"taskflow/tests/unit/conductor/test_blocking.py":[{"author":{"_account_id":12906,"name":"tonytan4ever","email":"tony.tan@rackspace.com","username":"tonytan4ever"},"change_message_id":"734ec04079ebc67d71c87884a191d57e33718efd","unresolved":false,"context_lines":[{"line_number":145,"context_line":"                    test_utils.WAIT_TIMEOUT))"},{"line_number":146,"context_line":"            components.board.post(\u0027poke\u0027, lb,"},{"line_number":147,"context_line":"                                  details\u003d{\u0027flow_uuid\u0027: fd.uuid})"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"            self.assertFalse(components.conductor.dispatching)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def test_fail_run(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a2ca52d_7127aa12","line":148,"updated":"2015-10-14 18:36:26.000000000","message":"Need this line:\nself.assertTrue(components.conductor.wait(test_utils.WAIT_TIMEOUT))\n\nTo make sure all job is dispatched.","commit_id":"0693c18230a7c1dd6d4dd6f6b771008e7e36a831"}],"taskflow/utils/iter_utils.py":[{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"dba925e5784043ce7e6d2b2b26eb79af607df681","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        i \u003d 0"},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            i +\u003d 1"},{"line_number":68,"context_line":"            yield i"},{"line_number":69,"context_line":"    else:"},{"line_number":70,"context_line":"        for i in compat_range(0, limit):"},{"line_number":71,"context_line":"            yield i"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_9854acff","line":68,"updated":"2015-10-15 19:39:50.000000000","message":"Should the increment happen after the yield.\n\nOtherwise I think this yields different things than the \u0027else\u0027 below (which starts at zero, while this one starts at one).","commit_id":"a04a85be111204adfe4951613d2d55ea822e394c"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"9a65ce61a1455362b4557c59910c61ada4fee586","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        i \u003d 0"},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            i +\u003d 1"},{"line_number":68,"context_line":"            yield i"},{"line_number":69,"context_line":"    else:"},{"line_number":70,"context_line":"        for i in compat_range(0, limit):"},{"line_number":71,"context_line":"            yield i"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a2ca52d_f86a80b2","line":68,"in_reply_to":"5a2ca52d_9854acff","updated":"2015-10-15 19:41:39.000000000","message":"Other idea:\n\n    \u003e\u003e\u003e import itertools\n    \u003e\u003e\u003e i \u003d itertools.count()\n    \u003e\u003e\u003e next(i)\n    0\n    \u003e\u003e\u003e next(i)\n    1\n    \u003e\u003e\u003e next(i)\n    2\n\nThen u can just `yield next(i)` and never have to increment anything :)","commit_id":"a04a85be111204adfe4951613d2d55ea822e394c"}]}
