)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"89e9492699f6c59491bf36f1f9ee1aea1daa014b","unresolved":false,"context_lines":[{"line_number":10,"context_line":"will create a zero-size image and fail when writing to it. If"},{"line_number":11,"context_line":"provided with zero size we now work out the size of each chunk"},{"line_number":12,"context_line":"being written and resize the rbd image prior to each write. This"},{"line_number":13,"context_line":"will be much slower than if new the image size on create but it"},{"line_number":14,"context_line":"will at least work."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"There is a corresponding glanceclient fix to ensure content-length"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAS3%2F%2F7dc%3D","line":13,"updated":"2013-09-17 02:50:20.000000000","message":"picky: Do you want to say \"knew\"?","commit_id":"1414c3fa8e12604a35e2c299dcac13830a419aaf"}],"glance/store/rbd.py":[{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"4b136b916b55f0e524d3a79d24d05f4f8f76c5b8","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                            length \u003d offset + len(chunk)"},{"line_number":291,"context_line":"                            LOG.debug(\"resizing image to %s KiB\" %"},{"line_number":292,"context_line":"                                      (length / 1024))"},{"line_number":293,"context_line":"                            image.resize(length)"},{"line_number":294,"context_line":"                        LOG.debug(\"writing chunk at offset %s\" % (offset))"},{"line_number":295,"context_line":"                        offset +\u003d image.write(chunk, offset)"},{"line_number":296,"context_line":"                        checksum.update(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAASX%2F%2F0rQ%3D","line":293,"updated":"2013-08-26 18:38:02.000000000","message":"How expensive is the call to image.resize?  If it is trivial then this is fine, otherwise we made need a better solution to getting the image size.","commit_id":"25ac835b17f4a64ddb514890b9fcbd4d094d758a"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"ec07870c02bd113adc03cfc2fa02791b36e66a72","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                            length \u003d offset + len(chunk)"},{"line_number":291,"context_line":"                            LOG.debug(\"resizing image to %s KiB\" %"},{"line_number":292,"context_line":"                                      (length / 1024))"},{"line_number":293,"context_line":"                            image.resize(length)"},{"line_number":294,"context_line":"                        LOG.debug(\"writing chunk at offset %s\" % (offset))"},{"line_number":295,"context_line":"                        offset +\u003d image.write(chunk, offset)"},{"line_number":296,"context_line":"                        checksum.update(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAASn%2F%2FniU%3D","line":293,"in_reply_to":"AAAASX%2F%2F0pY%3D","updated":"2013-09-03 11:57:03.000000000","message":"Ok I have gone for the option of fixing the glance client instead so that the image content-length is set in the request - see https://bugs.launchpad.net/python-glanceclient/+bug/1220197\n\nI think that we should still patch this zero-size case though. I propose the following for the case where size is zero and the image does not yet exist:\n\n(a) raise an exception\n\nor\n\n(b) work out size but doing a pre-iteration through the chunks","commit_id":"25ac835b17f4a64ddb514890b9fcbd4d094d758a"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"ab72954799629b9f918c3b129a08d590859be4fd","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                            length \u003d offset + len(chunk)"},{"line_number":291,"context_line":"                            LOG.debug(\"resizing image to %s KiB\" %"},{"line_number":292,"context_line":"                                      (length / 1024))"},{"line_number":293,"context_line":"                            image.resize(length)"},{"line_number":294,"context_line":"                        LOG.debug(\"writing chunk at offset %s\" % (offset))"},{"line_number":295,"context_line":"                        offset +\u003d image.write(chunk, offset)"},{"line_number":296,"context_line":"                        checksum.update(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAASX%2F%2F0pY%3D","line":293,"in_reply_to":"AAAASX%2F%2F0qk%3D","updated":"2013-08-26 18:48:19.000000000","message":"2 RTT of network latency per write actually sounds like quite a lot to me.  Is there any other way we can get the size in v2?  It should be there in some cases.","commit_id":"25ac835b17f4a64ddb514890b9fcbd4d094d758a"},{"author":{"_account_id":1107,"name":"Josh Durgin","email":"jdurgin@redhat.com","username":"jdurgin"},"change_message_id":"bdc2ea1880db9c68c34cb288bb28f56b29b54266","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                            length \u003d offset + len(chunk)"},{"line_number":291,"context_line":"                            LOG.debug(\"resizing image to %s KiB\" %"},{"line_number":292,"context_line":"                                      (length / 1024))"},{"line_number":293,"context_line":"                            image.resize(length)"},{"line_number":294,"context_line":"                        LOG.debug(\"writing chunk at offset %s\" % (offset))"},{"line_number":295,"context_line":"                        offset +\u003d image.write(chunk, offset)"},{"line_number":296,"context_line":"                        checksum.update(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAASX%2F%2F0qk%3D","line":293,"in_reply_to":"AAAASX%2F%2F0rQ%3D","updated":"2013-08-26 18:41:59.000000000","message":"It\u0027s roughly as expensive as 2 round trips + a write. Doubling the size every time we hit the end, and resizing to the correct size once all data is written would be more efficient. In practice, I don\u0027t think the speed of upload matters all that much though, so I\u0027m ok with it as is.","commit_id":"25ac835b17f4a64ddb514890b9fcbd4d094d758a"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"3d14346f52d4cacb43b842f8a1e7bdd2fc18c839","unresolved":false,"context_lines":[{"line_number":290,"context_line":"                            length \u003d offset + len(chunk)"},{"line_number":291,"context_line":"                            LOG.debug(\"resizing image to %s KiB\" %"},{"line_number":292,"context_line":"                                      (length / 1024))"},{"line_number":293,"context_line":"                            image.resize(length)"},{"line_number":294,"context_line":"                        LOG.debug(\"writing chunk at offset %s\" % (offset))"},{"line_number":295,"context_line":"                        offset +\u003d image.write(chunk, offset)"},{"line_number":296,"context_line":"                        checksum.update(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAASn%2F%2FbH8%3D","line":293,"in_reply_to":"AAAASn%2F%2FniU%3D","updated":"2013-09-04 21:51:55.000000000","message":"Hmm, I perfer a but i suppose b would be ok so long as a nice warning is logged.","commit_id":"25ac835b17f4a64ddb514890b9fcbd4d094d758a"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"b13f8bdd9bd5a634fcd40e909a973883dbab952d","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            with conn.open_ioctx(self.pool) as ioctx:"},{"line_number":271,"context_line":"                order \u003d int(math.log(self.chunk_size, 2))"},{"line_number":272,"context_line":"                LOG.debug(\u0027creating image %s with order %d\u0027,"},{"line_number":273,"context_line":"                          image_name, order)"},{"line_number":274,"context_line":"                try:"},{"line_number":275,"context_line":"                    location \u003d self._create_image(fsid, ioctx, image_name,"},{"line_number":276,"context_line":"                                                  image_size, order)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAASn%2F%2FbHA%3D","side":"PARENT","line":273,"updated":"2013-09-04 21:53:23.000000000","message":"if size is 0 I think it is important to at least log a warning that this will be slow.","commit_id":"0e77554b73169082e6a895059bdee27e6041f6e7"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"ea025227cc5b67ce8024c4f3738b2ee2037279f8","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            with conn.open_ioctx(self.pool) as ioctx:"},{"line_number":271,"context_line":"                order \u003d int(math.log(self.chunk_size, 2))"},{"line_number":272,"context_line":"                LOG.debug(\u0027creating image %s with order %d\u0027,"},{"line_number":273,"context_line":"                          image_name, order)"},{"line_number":274,"context_line":"                try:"},{"line_number":275,"context_line":"                    location \u003d self._create_image(fsid, ioctx, image_name,"},{"line_number":276,"context_line":"                                                  image_size, order)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAASn%2F%2FZTI%3D","side":"PARENT","line":273,"in_reply_to":"AAAASn%2F%2FbHA%3D","updated":"2013-09-05 08:26:18.000000000","message":"Done","commit_id":"0e77554b73169082e6a895059bdee27e6041f6e7"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c78db56018f198873ec86c6599e1b27e395af501","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                        chunks \u003d utils.chunkreadable(image_file,"},{"line_number":325,"context_line":"                                                     self.chunk_size)"},{"line_number":326,"context_line":"                        for chunk in chunks:"},{"line_number":327,"context_line":"                            # If the image size provided is zero we need to do"},{"line_number":328,"context_line":"                            # a resize for the amount we are writing. This will"},{"line_number":329,"context_line":"                            # be slower so setting a higher chunk size may"},{"line_number":330,"context_line":"                            # speed things up a bit."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FSdg%3D","line":327,"updated":"2013-09-30 19:59:40.000000000","message":"would you like you write ur name with a NOTE?","commit_id":"1414c3fa8e12604a35e2c299dcac13830a419aaf"}]}
