)]}'
{"swift/common/request_helpers.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9cad849c9e531a7432c7429ee7e95cc270774d18","unresolved":false,"context_lines":[{"line_number":438,"context_line":"        # Take the requests out of self._coalesce_requests, actually make"},{"line_number":439,"context_line":"        # the requests, and generate the bytes from the responses."},{"line_number":440,"context_line":"        #"},{"line_number":441,"context_line":"        # Yields 2-tuples (byte-chunk, segment-name). The segment name is"},{"line_number":442,"context_line":"        # used for logging."},{"line_number":443,"context_line":"        for data_or_req, seg_etag, seg_size in self._coalesce_requests():"},{"line_number":444,"context_line":"            if isinstance(data_or_req, bytes):  # ugly, awful overloading"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_86f3a273","line":441,"range":{"start_line":441,"start_character":27,"end_line":441,"end_character":51},"updated":"2018-01-27 02:28:08.000000000","message":"The actual yields seem to have these swapped.","commit_id":"27cae4b829ccda310d11f9858b936c26b690a886"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"f120317401ade3ab141f088ac4d866fc28c35b93","unresolved":false,"context_lines":[{"line_number":438,"context_line":"        # Take the requests out of self._coalesce_requests, actually make"},{"line_number":439,"context_line":"        # the requests, and generate the bytes from the responses."},{"line_number":440,"context_line":"        #"},{"line_number":441,"context_line":"        # Yields 2-tuples (byte-chunk, segment-name). The segment name is"},{"line_number":442,"context_line":"        # used for logging."},{"line_number":443,"context_line":"        for data_or_req, seg_etag, seg_size in self._coalesce_requests():"},{"line_number":444,"context_line":"            if isinstance(data_or_req, bytes):  # ugly, awful overloading"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_c6b501cf","line":441,"range":{"start_line":441,"start_character":27,"end_line":441,"end_character":51},"in_reply_to":"5f93b717_86f3a273","updated":"2018-02-07 00:03:07.000000000","message":"Done","commit_id":"27cae4b829ccda310d11f9858b936c26b690a886"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"94dde1468b9bda21e52caf1bc877c2af649ec802","unresolved":false,"context_lines":[{"line_number":517,"context_line":"                    else:"},{"line_number":518,"context_line":"                        yield chunk[:bytes_left]"},{"line_number":519,"context_line":"                        bytes_left -\u003d len(chunk)"},{"line_number":520,"context_line":"                        close_if_possible(seg_resp.app_iter)"},{"line_number":521,"context_line":"                        raise SegmentError("},{"line_number":522,"context_line":"                            \u0027Too many bytes for %(name)s; truncating in \u0027"},{"line_number":523,"context_line":"                            \u0027%(seg)s with %(left)d bytes left\u0027 %"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_3a30cd56","side":"PARENT","line":520,"range":{"start_line":520,"start_character":24,"end_line":520,"end_character":60},"updated":"2018-02-06 03:00:31.000000000","message":"This code is removed. But it is ok, because _internal_iter calls close_if_possible finally.","commit_id":"d6e911c623e9fdc921e5a1e23bb4bf28b228d983"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5bd1a7a7ec01a79c494f90e90b9e90ce477d8771","unresolved":false,"context_lines":[{"line_number":441,"context_line":"        # Yields 2-tuples (segment-name, byte-chunk). The segment name is"},{"line_number":442,"context_line":"        # used for logging."},{"line_number":443,"context_line":"        for data_or_req, seg_etag, seg_size in self._coalesce_requests():"},{"line_number":444,"context_line":"            if isinstance(data_or_req, bytes):  # ugly, awful overloading"},{"line_number":445,"context_line":"                yield (\u0027data segment\u0027, data_or_req)"},{"line_number":446,"context_line":"                continue"},{"line_number":447,"context_line":"            seg_req \u003d data_or_req"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_8a29f7e6","line":444,"range":{"start_line":444,"start_character":50,"end_line":444,"end_character":61},"updated":"2018-02-22 21:32:43.000000000","message":"Every iteration on this seems to clean things up a bit and make my comment feel over-stated... that or I\u0027m becoming complacent :P","commit_id":"98d185905a173fd7cbcbe1f6a71b74eb7564851c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"5bd1a7a7ec01a79c494f90e90b9e90ce477d8771","unresolved":false,"context_lines":[{"line_number":488,"context_line":"                if seg_hash:"},{"line_number":489,"context_line":"                    seg_hash.update(chunk)"},{"line_number":490,"context_line":"                yield (seg_req.path, chunk)"},{"line_number":491,"context_line":"            close_if_possible(seg_resp.app_iter)"},{"line_number":492,"context_line":""},{"line_number":493,"context_line":"            if seg_hash and seg_hash.hexdigest() !\u003d seg_resp.etag:"},{"line_number":494,"context_line":"                raise SegmentError("}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_24c33aef","line":491,"updated":"2018-02-22 21:32:43.000000000","message":"Kazuhiro brings up a good point -- should this be in a finally block, like\n\n try:\n     for chunk in itertools.chain.from_iterable(document_iters):\n         if seg_hash:\n             seg_hash.update(chunk)\n         yield (seg_req.path, chunk)\n finally:\n     close_if_possible(seg_resp.app_iter)\n\n? I\u0027m a little worried that we may not close properly if we get too many bytes, or if we exceed the time limit...\n\nAh, no! that\u0027s why we track self.current_resp and have\n\n finally:\n     if self.current_resp:\n         close_if_possible(self.current_resp.app_iter)\n\ndown in _internal_iter!","commit_id":"98d185905a173fd7cbcbe1f6a71b74eb7564851c"},{"author":{"_account_id":14766,"name":"Kazuhiro MIYAHARA","email":"miyahara.kazuhiro@lab.ntt.co.jp","username":"miyahara"},"change_message_id":"94dde1468b9bda21e52caf1bc877c2af649ec802","unresolved":false,"context_lines":[{"line_number":528,"context_line":"        for chunk in self._byte_counting_iter():"},{"line_number":529,"context_line":"            now \u003d time.time()"},{"line_number":530,"context_line":"            yield chunk"},{"line_number":531,"context_line":"            if now - start_time \u003e self.max_get_time:"},{"line_number":532,"context_line":"                raise SegmentError("},{"line_number":533,"context_line":"                    \u0027While processing manifest %s, \u0027"},{"line_number":534,"context_line":"                    \u0027max LO GET time of %ds exceeded\u0027 %"},{"line_number":535,"context_line":"                    (self.name, self.max_get_time))"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    def _internal_iter(self):"},{"line_number":538,"context_line":"        # Top level of our iterator stack: pass bytes through; catch and"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_faba65dc","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":51},"updated":"2018-02-06 03:00:31.000000000","message":"In original implementation, exceeded time is checked when ListingIterError raised in _coalesce_requests.\nBut it seems that exceeded time is NOT checked in this patch for ListingIterError.\nWas this done on purpose?","commit_id":"98d185905a173fd7cbcbe1f6a71b74eb7564851c"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"f120317401ade3ab141f088ac4d866fc28c35b93","unresolved":false,"context_lines":[{"line_number":528,"context_line":"        for chunk in self._byte_counting_iter():"},{"line_number":529,"context_line":"            now \u003d time.time()"},{"line_number":530,"context_line":"            yield chunk"},{"line_number":531,"context_line":"            if now - start_time \u003e self.max_get_time:"},{"line_number":532,"context_line":"                raise SegmentError("},{"line_number":533,"context_line":"                    \u0027While processing manifest %s, \u0027"},{"line_number":534,"context_line":"                    \u0027max LO GET time of %ds exceeded\u0027 %"},{"line_number":535,"context_line":"                    (self.name, self.max_get_time))"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"    def _internal_iter(self):"},{"line_number":538,"context_line":"        # Top level of our iterator stack: pass bytes through; catch and"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_de40a40a","line":535,"range":{"start_line":531,"start_character":0,"end_line":535,"end_character":51},"in_reply_to":"3fa0c359_faba65dc","updated":"2018-02-07 00:03:07.000000000","message":"Yes, that was intentional. \n\nTypically, getting the next segment out of self.listing_iter is very fast. Most of the time, it is simply yielding a value already in memory. For example, SLO\u0027s listing_iter loads a manifest, then yields each segment. Thus, the amount of time that passes between (a) yielding the last chunk of segment N and (b) getting the next value from self.listing_iter is very small, so there is a low probability that the time would be exceeded in the interval between (b) and (a).\n\nIn the worst case, this could cause loading of one more submanifest (SLO) or one more page of container listing (DLO) than the previous code would have. However, the probability of that event is low, and in my opinion, the improved readability of this change is worth the tradeoff.","commit_id":"98d185905a173fd7cbcbe1f6a71b74eb7564851c"}]}
