)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"572f57161550c7ff94e6075ba7b44c3e2de1a83a","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dharini Chandrasekar \u003cdharini.chandrasekar@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-01-10 00:50:08 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"euffered reader: Upload recovery for swift store"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During segmented (chunked) uploads of large files to Swift, if a"},{"line_number":10,"context_line":"single segment fails to upload, Glance will abort the entire"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"ba5201f7_f7d5321b","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":1},"updated":"2017-01-10 14:20:48.000000000","message":"Looks like a typo crept in here?","commit_id":"7afea63f39e832b7deb874d8eb846ea0a8707a13"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"b5f1a87648124e5b999b0b2e1ec7cdde18998761","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dharini Chandrasekar \u003cdharini.chandrasekar@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-01-10 00:50:08 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"euffered reader: Upload recovery for swift store"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"During segmented (chunked) uploads of large files to Swift, if a"},{"line_number":10,"context_line":"single segment fails to upload, Glance will abort the entire"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"ba5201f7_0e961594","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":1},"in_reply_to":"ba5201f7_f7d5321b","updated":"2017-01-10 18:47:37.000000000","message":"Done","commit_id":"7afea63f39e832b7deb874d8eb846ea0a8707a13"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"b3deffc476cdc9189a1bb5a1c56b1c5167918252","unresolved":false,"context_lines":[{"line_number":21,"context_line":"glance_store._drivers.swift.store.ChunkReader.)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"TODO: If the allotted space for buffering is full, add logic to"},{"line_number":24,"context_line":"revert to direct upload to Swift without buffering."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Co-Authored-By: Brian Elliott \u003cbdelliott@gmail.com\u003e"},{"line_number":27,"context_line":"Co-Authored-By: Hemanth Makkapati \u003chemanth.makkapati@rackspace.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"7a3c09a3_bf773807","line":24,"updated":"2017-01-18 23:16:54.000000000","message":"Is this TODO the reason for Partially Implements? If so, might be better to express this rather than a TODO suggesting this patch is incomplete.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":21,"context_line":"glance_store._drivers.swift.store.ChunkReader.)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"TODO: If the allotted space for buffering is full, add logic to"},{"line_number":24,"context_line":"revert to direct upload to Swift without buffering."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Co-Authored-By: Brian Elliott \u003cbdelliott@gmail.com\u003e"},{"line_number":27,"context_line":"Co-Authored-By: Hemanth Makkapati \u003chemanth.makkapati@rackspace.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":35,"id":"7a3c09a3_8b195725","line":24,"in_reply_to":"7a3c09a3_bf773807","updated":"2017-01-19 21:01:20.000000000","message":"Yes Jesse. As per the spec, this is something we are yet to add. But, adding this logic might add some overhead with how uploads to swift work.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"}],"glance_store/_drivers/swift/buffered.py":[{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e9cfd97c68a8f727bbe7e96777abc989db878b81","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        available \u003d len(self.buf) - self.offset"},{"line_number":62,"context_line":"        request_sz \u003d min(request_sz, available)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        end \u003d min(self.offset + request_sz, self.total)"},{"line_number":65,"context_line":"        result \u003d self.buf[self.offset:end]"},{"line_number":66,"context_line":"        self.offset \u003d end"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_534c2f9e","line":64,"updated":"2014-09-15 16:45:20.000000000","message":"Will always select self.offset + request_sz because of previous min ensures you won\u0027t reach beyond buffer?","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"944f16e8d52fa7feb5de6e925ccfdeb0c6253d31","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        available \u003d len(self.buf) - self.offset"},{"line_number":62,"context_line":"        request_sz \u003d min(request_sz, available)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        end \u003d min(self.offset + request_sz, self.total)"},{"line_number":65,"context_line":"        result \u003d self.buf[self.offset:end]"},{"line_number":66,"context_line":"        self.offset \u003d end"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_5cca621b","line":64,"in_reply_to":"fa98f980_534c2f9e","updated":"2014-09-16 15:13:29.000000000","message":"Yes, that is the idea.  You don\u0027t want to read into the next segment on the input stream.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f31c7336aaa3ad670479c1770553c69037ce725a","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        available \u003d len(self.buf) - self.offset"},{"line_number":62,"context_line":"        request_sz \u003d min(request_sz, available)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        end \u003d min(self.offset + request_sz, self.total)"},{"line_number":65,"context_line":"        result \u003d self.buf[self.offset:end]"},{"line_number":66,"context_line":"        self.offset \u003d end"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a0a318ff","line":64,"in_reply_to":"fa98f980_5cca621b","updated":"2014-09-16 18:20:12.000000000","message":"I think the previous min() ensures that self.offset + request_sz won\u0027t extend into the next segment on the input stream. I was thinking that this min is extraneous. Either way, leaving it won\u0027t hurt.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"cdcf4df7ffa3a3a99d03c2f73dab885b0e2e529b","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        available \u003d len(self.buf) - self.offset"},{"line_number":62,"context_line":"        request_sz \u003d min(request_sz, available)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        end \u003d min(self.offset + request_sz, self.total)"},{"line_number":65,"context_line":"        result \u003d self.buf[self.offset:end]"},{"line_number":66,"context_line":"        self.offset \u003d end"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_cb8026fa","line":64,"in_reply_to":"fa98f980_a0a318ff","updated":"2014-09-17 14:47:29.000000000","message":"Jesse - The previous min limits to the amount of data in the buffer, not just the end of the chunk size.  Also, it is possible that the last chunk in the input file is actually smaller than self.total, in which case you don\u0027t want to have end be after the end of the file.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"29071dab71278a82ee296319b7130b7079ada9c4","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        available \u003d len(self.buf) - self.offset"},{"line_number":62,"context_line":"        request_sz \u003d min(request_sz, available)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        end \u003d min(self.offset + request_sz, self.total)"},{"line_number":65,"context_line":"        result \u003d self.buf[self.offset:end]"},{"line_number":66,"context_line":"        self.offset \u003d end"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_c4665329","line":64,"in_reply_to":"fa98f980_cb8026fa","updated":"2014-09-17 16:24:35.000000000","message":"When is it possible for self.total to be less than len(self.buf)?\n\nend \u003d min(self.offset + request_sz, self.total)\nend \u003d min(self.offset + available, self.total)\nend \u003d min(self.offset + (len(self.buf) - self.offset), self.total)\nend \u003d min(len(self.buf), self.total)\n\nWouldn\u0027t the first argument always be selected by the min function?","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e8bdd99dbed41937f6a4b53b892eae7e52f81efa","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        file buffer.  Then return data out of that buffer."},{"line_number":51,"context_line":"        \"\"\""},{"line_number":52,"context_line":"        # First buffer as much as the full chunk size."},{"line_number":53,"context_line":"        if not self._buffered:"},{"line_number":54,"context_line":"            self._buffer()"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        # Now playback out of that buffer to the caller"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_f62652b9","line":53,"updated":"2015-08-18 19:02:18.000000000","message":"Should this be getting set back to False somewhere. It seems to only be set in __init__, and read only reads up to a chunks worth of data, so I\u0027m guessing swift (connection.put) code is reading until it gets an EOF? If this is called multiple times, it seems to only try to buffer the first bit. Maybe I\u0027m missing something.","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"dd963010fc7eb0b8235e0edd5213964775d2fc0c","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":70,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":71,"context_line":"                break"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                remaining -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_b2a626bf","line":70,"updated":"2015-08-12 16:13:25.000000000","message":"Does this not mean 1 of 3 things:\n\n1. remaining was 0 and 0 was read, remainder of chunk read\n2. EOF\n3. Socket closed or is closing\n\nCorrect me if I\u0027m wrong. We should always read what is remaining in a non-error case. This makes the comment at the top of this method a bit confusing. We are reading in a loop, so we will read the remainder of the chunk, never less (in a non-error case).\n\nTL;DR: The comment confuses me. The code looks correct.","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"2e2c70818ecefa27cd731ac3d6e15a855eceddba","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":70,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":71,"context_line":"                break"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                remaining -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_e49830cf","line":70,"in_reply_to":"1a4dcd0f_b2a626bf","updated":"2015-08-13 16:54:47.000000000","message":"It does mean those three things. \nI don\u0027t know what that comment means exactly. I\u0027d have to ask for Brian Elliot\u0027s help.","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"e047335f2ff474e209f3d2bf5fc79a3cad2a650d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":70,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":71,"context_line":"                break"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                remaining -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_e7002d69","line":70,"in_reply_to":"1a4dcd0f_e49830cf","updated":"2015-08-13 19:17:02.000000000","message":"self.fd is a non-blocking file descriptor, so read() can return 0 bytes..and it isn\u0027t necessarily EOF.  Basically this short-circuits on the first 0 byte read, not necessarily the \"sz\" value that the swift client tried to read.  Does that help any?","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e8bdd99dbed41937f6a4b53b892eae7e52f81efa","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":70,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":71,"context_line":"                break"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                remaining -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_b3122c61","line":70,"in_reply_to":"1a4dcd0f_e7002d69","updated":"2015-08-18 19:02:18.000000000","message":"If does, thanks.","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"1a110200a9b65e9523ac1a868049d3ffef3399a5","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":70,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":71,"context_line":"                break"},{"line_number":72,"context_line":"            else:"},{"line_number":73,"context_line":"                remaining -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_b0fee536","line":70,"in_reply_to":"fa1b9901_b3122c61","updated":"2015-08-21 21:09:07.000000000","message":"Brian and I looked into this further. There is no possibility of losing any image data here. At least, BufferedReader is not introducing any new possibility that didn\u0027t exist before. Here [1] is how eventlet handles recv on the socket. If there is nothing to read yet, eventlet doesn\u0027t return 0. It suspends the coroutine until it is ready to read again from the socket. So, 0 bytes is EOF indeed!\n\nLet me know if this helps.\n\n[1] https://github.com/eventlet/eventlet/blob/master/eventlet/greenio/base.py#L307-L329","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5f564a07","line":1,"updated":"2015-08-24 10:45:25.000000000","message":"NIT: 2015","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_f330a409","line":1,"in_reply_to":"fa1b9901_5f564a07","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.checksum \u003d initial_checksum.copy()"},{"line_number":43,"context_line":"        self.total \u003d total"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile()"},{"line_number":46,"context_line":"        self._buffered \u003d False"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def read(self, sz):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5ff2ca07","line":45,"updated":"2015-08-24 10:45:25.000000000","message":"We _seriously_ should use the path defined for the image cache here when creating the file buffer.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.checksum \u003d initial_checksum.copy()"},{"line_number":43,"context_line":"        self.total \u003d total"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile()"},{"line_number":46,"context_line":"        self._buffered \u003d False"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def read(self, sz):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_53539039","line":45,"in_reply_to":"fa1b9901_5ff2ca07","updated":"2015-08-24 17:40:25.000000000","message":"I don\u0027t necessarily agree with this. May be I miss the point here. But, why do we want to fill up the image cache with disk buffering? Image cache is used for downloads. And, this is for uploads. It is intentionally kept separate to eliminate the impact of one on the other. \n\nAlso, in the mid-cycle, we discussed about introducing a config to limit the space used for disk buffering. I will introduce this in a following patch. In that patch, I can also introduce another config to indicate the path that should be used for disk buffering during uploads. How about that?\n\nLet me know if I\u0027m missing your point here.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":58,"context_line":"        sz \u003d min(sz, remaining)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        return self._read(sz)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _buffer(self):"},{"line_number":63,"context_line":"        # buffer as much as the remainder of the chunk"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_7f39ce40","line":60,"updated":"2015-08-24 10:45:25.000000000","message":"This feels frustrating inefficient, any chance we could yield the data when buffering and only read back from the self._tmpfile if we need to rewind the buffer due failure?","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":58,"context_line":"        sz \u003d min(sz, remaining)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        return self._read(sz)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _buffer(self):"},{"line_number":63,"context_line":"        # buffer as much as the remainder of the chunk"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5667feb6","line":60,"in_reply_to":"fa1b9901_7f39ce40","updated":"2015-08-24 17:40:25.000000000","message":"You bring up a good point. We did talk about this at the mid-cycle. We arrived at the conclusion that this should be implemented as a tee operation. Again, this is one of the changes I plan to do as a follow up patch. \n\nI was keen on getting this in first as it\u0027s been around for a year now.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":68,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":69,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":70,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_bf3be69b","line":67,"updated":"2015-08-24 10:45:25.000000000","message":"please be consistent either way with L 58","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":68,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":69,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":70,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_1602e609","line":67,"in_reply_to":"fa1b9901_bf3be69b","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                break"},{"line_number":71,"context_line":"            else:"},{"line_number":72,"context_line":"                remaining -\u003d len(buf)"},{"line_number":73,"context_line":"                self._tmpfile.write(buf)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        self._tmpfile.seek(0)"},{"line_number":76,"context_line":"        self._buffered \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_7f130e0e","line":73,"updated":"2015-08-24 10:45:25.000000000","message":"NIT: We should write first, then remove the written size from \"remaining\"?","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"                break"},{"line_number":71,"context_line":"            else:"},{"line_number":72,"context_line":"                remaining -\u003d len(buf)"},{"line_number":73,"context_line":"                self._tmpfile.write(buf)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        self._tmpfile.seek(0)"},{"line_number":76,"context_line":"        self._buffered \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_169e66b8","line":73,"in_reply_to":"fa1b9901_7f130e0e","updated":"2015-08-24 17:40:25.000000000","message":"Good one :)","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self._tmpfile.seek(0)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        while remaining \u003e 0:"},{"line_number":96,"context_line":"            read_sz \u003d min(READ_SZ, remaining)"},{"line_number":97,"context_line":"            buf \u003d self._tmpfile.read(read_sz)"},{"line_number":98,"context_line":"            self.checksum.update(buf)"},{"line_number":99,"context_line":"            remaining -\u003d read_sz"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5f25ea59","line":96,"updated":"2015-08-24 10:45:25.000000000","message":"NIT: Can we be consistent with the order?","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self._tmpfile.seek(0)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"        while remaining \u003e 0:"},{"line_number":96,"context_line":"            read_sz \u003d min(READ_SZ, remaining)"},{"line_number":97,"context_line":"            buf \u003d self._tmpfile.read(read_sz)"},{"line_number":98,"context_line":"            self.checksum.update(buf)"},{"line_number":99,"context_line":"            remaining -\u003d read_sz"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_d60b0e23","line":96,"in_reply_to":"fa1b9901_5f25ea59","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        return self._tmpfile.tell()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @property"},{"line_number":107,"context_line":"    def bytes_read(self):"},{"line_number":108,"context_line":"        # just used for debug logging"},{"line_number":109,"context_line":"        return self.tell()"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_5fb3aa0a","line":107,"updated":"2015-08-24 10:45:25.000000000","message":"I don\u0027t see this called anywhere.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        return self._tmpfile.tell()"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @property"},{"line_number":107,"context_line":"    def bytes_read(self):"},{"line_number":108,"context_line":"        # just used for debug logging"},{"line_number":109,"context_line":"        return self.tell()"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_d659ce36","line":107,"in_reply_to":"fa1b9901_5fb3aa0a","updated":"2015-08-24 17:40:25.000000000","message":"https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/swift/store.py#L557","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":12631,"name":"Bogun Dmitriy","email":"dbogun@mirantis.com","username":"dbogun"},"change_message_id":"685bdb120ecb428e5b53c6c9bfa5b5968fc7f34c","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":68,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":69,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":70,"context_line":"                break"},{"line_number":71,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_78026174","line":68,"updated":"2015-09-08 21:42:44.000000000","message":"try:\n    buf \u003d self.fd.read(remaining)\nexcept IOError as e:\n    # We actually don\u0027t know what exactly self.fd is. And as result we\n    # don\u0027t know which exception it can raise. To pass \"retry\"\n    # mechanism inside swift client we must limit possible set of\n    # errors.\n    # Known exceptions that break \"retry\" mechanism:\n    #  - webob.request.DisconnectionError\n    raise socket.error(*e.args)","commit_id":"4fd4c3dbc2a56a294fe94ed1e190d62481a94a06"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"8202fb374f817dc651d278b095c20433210ac4f9","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        while True:"},{"line_number":67,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":68,"context_line":"            buf \u003d self.fd.read(read_sz)"},{"line_number":69,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":70,"context_line":"                break"},{"line_number":71,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da20952f_549961cf","line":68,"in_reply_to":"da20952f_78026174","updated":"2015-09-09 03:29:46.000000000","message":"Done\n\nThanks, Bogun. That\u0027s a good suggestion!\nYou described it well. So, I\u0027m going to retain your comment too :)","commit_id":"4fd4c3dbc2a56a294fe94ed1e190d62481a94a06"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"b627f8b45e0fc51f2850ed668e36593454b6aa36","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.checksum \u003d initial_checksum.copy()"},{"line_number":44,"context_line":"        self.total \u003d total"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile()"},{"line_number":47,"context_line":"        self._buffered \u003d False"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def read(self, sz):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_e5ae7184","line":46,"updated":"2015-12-07 01:36:26.000000000","message":"Should this file be created in a \"provisionable\" directory? For instance, we use the `work_dir` directory for storing data when importing them using tasks. Can that be re-used here?\n\n\ntemp files in temp dirs are normally considered a security flaw as well.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"e9e90876c27863d7ac886a7391df2ce9955a4f71","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.checksum \u003d initial_checksum.copy()"},{"line_number":44,"context_line":"        self.total \u003d total"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile()"},{"line_number":47,"context_line":"        self._buffered \u003d False"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def read(self, sz):"}],"source_content_type":"text/x-python","patch_set":14,"id":"bae84128_9f353348","line":46,"in_reply_to":"7a740942_b438083f","updated":"2016-02-19 18:05:33.000000000","message":"Flavio, you want me to use the \u0027work_dir\u0027 here?","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e0193bb29f0287c92f027b5f059fb348c05cd865","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.checksum \u003d initial_checksum.copy()"},{"line_number":44,"context_line":"        self.total \u003d total"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile()"},{"line_number":47,"context_line":"        self._buffered \u003d False"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def read(self, sz):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_b438083f","line":46,"in_reply_to":"7a740942_e5ae7184","updated":"2015-12-09 13:38:23.000000000","message":"Yes, the S3 driver also uses TemporaryFile, but passes a \"dir\" argument to make sure the temporary file is not created in /tmp (see glance_store/_drivers/s3.py).","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e0193bb29f0287c92f027b5f059fb348c05cd865","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":65,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            try:"},{"line_number":70,"context_line":"                buf \u003d self.fd.read(read_sz)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_63c9805a","line":67,"updated":"2015-12-09 13:38:23.000000000","message":"Instead of doing \"while True: ... break\", couldn\u0027t we do \"while remaining \u003e 0\" and avoir the break? That seems like a sane control flow mechanism.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"e9e90876c27863d7ac886a7391df2ce9955a4f71","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":65,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        while True:"},{"line_number":68,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":69,"context_line":"            try:"},{"line_number":70,"context_line":"                buf \u003d self.fd.read(read_sz)"}],"source_content_type":"text/x-python","patch_set":14,"id":"bae84128_1fa0039f","line":67,"in_reply_to":"7a740942_63c9805a","updated":"2016-02-19 18:05:33.000000000","message":"It is a saner control flow for sure, but it may not work here from what I can tell. Let\u0027s take the last image segment, which is usually smaller than the segment size we would like to upload. In such a case, \u0027while remaining \u003e0 \u0027 would go into infinite loop waiting for data that will never arrive.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e0193bb29f0287c92f027b5f059fb348c05cd865","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            try:"},{"line_number":70,"context_line":"                buf \u003d self.fd.read(read_sz)"},{"line_number":71,"context_line":"            except IOError as e:"},{"line_number":72,"context_line":"                # We actually don\u0027t know what exactly self.fd is. And as a"},{"line_number":73,"context_line":"                # result we don\u0027t know which exception it may raise. To pass"},{"line_number":74,"context_line":"                # the retry mechanism inside swift client we must limit the"},{"line_number":75,"context_line":"                # possible set of errors."}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_83cd8c5f","line":72,"updated":"2015-12-09 13:38:23.000000000","message":"What can self.fd possibly be? Can\u0027t we really catch a less generic exception?","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"35c4b6c22706bf352c69955bcd05e00f2d9159e0","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        while remaining \u003e 0:"},{"line_number":104,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":105,"context_line":"            buf \u003d self._tmpfile.read(read_sz)"},{"line_number":106,"context_line":"            self.checksum.update(buf)"},{"line_number":107,"context_line":"            remaining -\u003d read_sz"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        self._tmpfile.seek(offset)"}],"source_content_type":"text/x-python","patch_set":14,"id":"fa69d971_a6f151cf","line":106,"updated":"2016-01-08 21:12:49.000000000","message":"Maybe\n\n    self._read(read_sz)\n\n? Just to reduce the number places we have to manually manage the checksum.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"e9e90876c27863d7ac886a7391df2ce9955a4f71","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        while remaining \u003e 0:"},{"line_number":104,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"},{"line_number":105,"context_line":"            buf \u003d self._tmpfile.read(read_sz)"},{"line_number":106,"context_line":"            self.checksum.update(buf)"},{"line_number":107,"context_line":"            remaining -\u003d read_sz"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        self._tmpfile.seek(offset)"}],"source_content_type":"text/x-python","patch_set":14,"id":"bae84128_7fecafc7","line":106,"in_reply_to":"fa69d971_a6f151cf","updated":"2016-02-19 18:05:33.000000000","message":"Sure, good catch!","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8751a5c66a3f7d0af717516f9d6b3f5ab18c197","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self, fd, initial_checksum, total, verifier\u003dNone):"},{"line_number":60,"context_line":"        self.fd \u003d fd"},{"line_number":61,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":62,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":63,"context_line":"        self.total \u003d total"},{"line_number":64,"context_line":"        self.verifier \u003d verifier"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_f87c2eed","line":61,"updated":"2016-02-21 08:52:08.000000000","message":"Since we\u0027re still working with a copy of the checksum (which is good! otherwise we can\u0027t properly reset the reader; the checksum would get the same content ranges more than once), aren\u0027t we still going to need to reassign checksum in the caller?","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"720a08bf80942b229fe1c282b3d62313d34c7ea5","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self, fd, initial_checksum, total, verifier\u003dNone):"},{"line_number":60,"context_line":"        self.fd \u003d fd"},{"line_number":61,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":62,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":63,"context_line":"        self.total \u003d total"},{"line_number":64,"context_line":"        self.verifier \u003d verifier"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_fbf87d4b","line":61,"in_reply_to":"bae84128_f87c2eed","updated":"2016-02-22 18:19:32.000000000","message":"Like you correctly pointed out, \u0027self._initial_checksum\u0027 is only a copy we keep to reset the reader in the event of a \u0027seek\u0027 operation. It is not used to actively advance the checksum during the \u0027read\u0027 operation. \u0027self.checksum\u0027 is what\u0027s being used for that purpose. And, it is an object-reference to whatever checksum the caller passed in. And, it is not an immutable object either. So, why do we still need to reassign the checksum in the caller?\n\nLet me know if I\u0027m missing something really obvious here.","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8751a5c66a3f7d0af717516f9d6b3f5ab18c197","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        \"\"\""},{"line_number":84,"context_line":"        # First buffer as much as the full chunk size."},{"line_number":85,"context_line":"        if not self._buffered:"},{"line_number":86,"context_line":"            self._buffer()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":89,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_3887b6d8","line":86,"updated":"2016-02-21 08:52:08.000000000","message":"Is this necessary, since we call self._buffer() in __init__?","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"720a08bf80942b229fe1c282b3d62313d34c7ea5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        \"\"\""},{"line_number":84,"context_line":"        # First buffer as much as the full chunk size."},{"line_number":85,"context_line":"        if not self._buffered:"},{"line_number":86,"context_line":"            self._buffer()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":89,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_dbe819e5","line":86,"in_reply_to":"bae84128_3887b6d8","updated":"2016-02-22 18:19:32.000000000","message":"You\u0027re right, it is not required here. I left in there as a double-check (although if the buffering fails during the first attempt, it\u0027ll most likely bomb.)\n\nI can get rid of it.","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8751a5c66a3f7d0af717516f9d6b3f5ab18c197","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_986ec22d","line":101,"updated":"2016-02-21 08:52:08.000000000","message":"Would we ever expect self._tmpfile.tell() to return something other than 0?","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"720a08bf80942b229fe1c282b3d62313d34c7ea5","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_bbc6f546","line":101,"in_reply_to":"bae84128_986ec22d","updated":"2016-02-22 18:19:32.000000000","message":"Nope. It should be zero and that is exactly what \u0027tell\u0027 should return as well.","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8751a5c66a3f7d0af717516f9d6b3f5ab18c197","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        LOG.debug(\"Seek from %s to %s\" % (self._tmpfile.tell(), offset))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # backing up, re-calculate the checksum"},{"line_number":136,"context_line":"        self.checksum \u003d self._initial_checksum.copy()"},{"line_number":137,"context_line":"        remaining \u003d offset"},{"line_number":138,"context_line":"        self._tmpfile.seek(0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_d8784af5","line":136,"updated":"2016-02-21 08:52:08.000000000","message":"We reset the checksum, but what about the verifier? Is there a way to reset that?","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":15524,"name":"dane-fichter","email":"dane.fichter@jhuapl.edu","username":"dane-fichter"},"change_message_id":"567ec09aa96f675722cb6a3eb7617e12274b2602","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        LOG.debug(\"Seek from %s to %s\" % (self._tmpfile.tell(), offset))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # backing up, re-calculate the checksum"},{"line_number":136,"context_line":"        self.checksum \u003d self._initial_checksum.copy()"},{"line_number":137,"context_line":"        remaining \u003d offset"},{"line_number":138,"context_line":"        self._tmpfile.seek(0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9aed3d3a_f20489c7","line":136,"in_reply_to":"bae84128_7c9aa064","updated":"2016-02-25 20:52:08.000000000","message":"You\u0027d have to perform a deep copy of the verifier object once it\u0027s been created, but before any chunks of image data have been passed to its update() method. Pretty similar to the current approach Hemanth is taking with the checksum.","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"720a08bf80942b229fe1c282b3d62313d34c7ea5","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        LOG.debug(\"Seek from %s to %s\" % (self._tmpfile.tell(), offset))"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        # backing up, re-calculate the checksum"},{"line_number":136,"context_line":"        self.checksum \u003d self._initial_checksum.copy()"},{"line_number":137,"context_line":"        remaining \u003d offset"},{"line_number":138,"context_line":"        self._tmpfile.seek(0)"},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bae84128_7c9aa064","line":136,"in_reply_to":"bae84128_d8784af5","updated":"2016-02-22 18:19:32.000000000","message":"Good catch. Looking into this.","commit_id":"e9428c4bb828e12938bedefacf2ffbd2e4e282d6"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                      \u0027swift. This is required only when the config\u0027"},{"line_number":33,"context_line":"                      \u0027swift_buffer_on_upload is set to True.\u0027"},{"line_number":34,"context_line":"                      \u0027This directory should be provisioned keeping in mind \u0027"},{"line_number":35,"context_line":"                      \u0027the swift_store_large_object_chunk_size and the max. \u0027"},{"line_number":36,"context_line":"                      \u0027number of images that could be uploaded simultaneously \u0027"},{"line_number":37,"context_line":"                      \u0027by a given glance node.\u0027)),"},{"line_number":38,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_112071f6","line":35,"updated":"2017-01-06 18:49:23.000000000","message":"How do you set the max number of images that could be uploaded simultaneously? Is there a config option? It\u0027s not immediately apparent reading just the help text. Also, why is there a period after max?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                      \u0027swift. This is required only when the config\u0027"},{"line_number":33,"context_line":"                      \u0027swift_buffer_on_upload is set to True.\u0027"},{"line_number":34,"context_line":"                      \u0027This directory should be provisioned keeping in mind \u0027"},{"line_number":35,"context_line":"                      \u0027the swift_store_large_object_chunk_size and the max. \u0027"},{"line_number":36,"context_line":"                      \u0027number of images that could be uploaded simultaneously \u0027"},{"line_number":37,"context_line":"                      \u0027by a given glance node.\u0027)),"},{"line_number":38,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_b7acee8c","line":35,"in_reply_to":"ba5201f7_112071f6","updated":"2017-01-07 00:12:30.000000000","message":"I might be wrong, but I do not think we have any configuration option that sets a limit on the number of images that a user can upload to swift store. Maybe we should convey more strongly to the user that he should set aside a dir after evaluating the approximate total images sizes?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"51eabf7eb77fc9109d48cc965209a0a66fce8bcf","unresolved":false,"context_lines":[{"line_number":32,"context_line":"                      \u0027swift. This is required only when the config\u0027"},{"line_number":33,"context_line":"                      \u0027swift_buffer_on_upload is set to True.\u0027"},{"line_number":34,"context_line":"                      \u0027This directory should be provisioned keeping in mind \u0027"},{"line_number":35,"context_line":"                      \u0027the swift_store_large_object_chunk_size and the max. \u0027"},{"line_number":36,"context_line":"                      \u0027number of images that could be uploaded simultaneously \u0027"},{"line_number":37,"context_line":"                      \u0027by a given glance node.\u0027)),"},{"line_number":38,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_4b0daf36","line":35,"in_reply_to":"ba5201f7_b7acee8c","updated":"2017-01-09 16:31:28.000000000","message":"Hmm. Take number of snapshots that would cause out of disk space given a configured chunk size \u003d\u003d DoS?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    There exists a possibility where the disk space consumed for buffering MAY"},{"line_number":54,"context_line":"    eat into the disk space available for glance cache. This may affect image"},{"line_number":55,"context_line":"    download performance. So, extra care should be taken while deploying this"},{"line_number":56,"context_line":"    to ensure there is enough disk space available."},{"line_number":57,"context_line":"    \"\"\""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def __init__(self, fd, initial_checksum, total, initial_verifier\u003dNone):"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_91e701ab","line":56,"updated":"2017-01-06 18:49:23.000000000","message":"An all caps warning is more suited for the config options set by the operator than in the class, though the information is still relevant.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def __init__(self, fd, initial_checksum, total, initial_verifier\u003dNone):"},{"line_number":60,"context_line":"        self.fd \u003d fd"},{"line_number":61,"context_line":"        self.total \u003d total"},{"line_number":62,"context_line":"        # maintaining copies of checksum and verifier to use, in case of a"},{"line_number":63,"context_line":"        # seek operation. The updated checksum and verifier are sent back"},{"line_number":64,"context_line":"        # to the caller."},{"line_number":65,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_51bf5960","line":62,"updated":"2017-01-06 18:49:23.000000000","message":"Nit: Maintain copies...","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def __init__(self, fd, initial_checksum, total, initial_verifier\u003dNone):"},{"line_number":60,"context_line":"        self.fd \u003d fd"},{"line_number":61,"context_line":"        self.total \u003d total"},{"line_number":62,"context_line":"        # maintaining copies of checksum and verifier to use, in case of a"},{"line_number":63,"context_line":"        # seek operation. The updated checksum and verifier are sent back"},{"line_number":64,"context_line":"        # to the caller."},{"line_number":65,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_940a8824","line":62,"in_reply_to":"ba5201f7_51bf5960","updated":"2017-01-07 00:12:30.000000000","message":"Done","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # seek operation. The updated checksum and verifier are sent back"},{"line_number":64,"context_line":"        # to the caller."},{"line_number":65,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":66,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":67,"context_line":"        self.verifier \u003d initial_verifier"},{"line_number":68,"context_line":"        if self.verifier:"},{"line_number":69,"context_line":"            self._initial_verifier \u003d initial_verifier.copy()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_548bc71e","line":66,"updated":"2017-01-06 18:49:23.000000000","message":"Is this the checksum up to the new chunk or up to and including the new chunk?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        # seek operation. The updated checksum and verifier are sent back"},{"line_number":64,"context_line":"        # to the caller."},{"line_number":65,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":66,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":67,"context_line":"        self.verifier \u003d initial_verifier"},{"line_number":68,"context_line":"        if self.verifier:"},{"line_number":69,"context_line":"            self._initial_verifier \u003d initial_verifier.copy()"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_5414a04b","line":66,"in_reply_to":"ba5201f7_548bc71e","updated":"2017-01-07 00:12:30.000000000","message":"This is the checksum computed right before the chunk upload is attempted.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self._buffer()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":94,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":95,"context_line":"        sz \u003d min(remaining, sz)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        return self._read(sz)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_34d643f1","line":94,"updated":"2017-01-06 18:49:23.000000000","message":"NOTE: Easy place for off by 1 error. Checksum verification after segment upload should verify this is correct.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self._buffer()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":94,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":95,"context_line":"        sz \u003d min(remaining, sz)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        return self._read(sz)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_d7dfb2d3","line":94,"in_reply_to":"ba5201f7_34d643f1","updated":"2017-01-07 00:12:30.000000000","message":"Jesse, can you please help me understand how we can verify this with the checksum?\nRegarding the OBOB, since tell() on our tempfile will include zero positioning with respect to our total (chunk_size), I think this computation here should be fine. We can still reverify to be sure.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"51eabf7eb77fc9109d48cc965209a0a66fce8bcf","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            self._buffer()"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":94,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":95,"context_line":"        sz \u003d min(remaining, sz)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        return self._read(sz)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_0b648747","line":94,"in_reply_to":"ba5201f7_d7dfb2d3","updated":"2017-01-09 16:31:28.000000000","message":"Just a comment that this is an easy place for an accidental off by one, but since we are doing tests to verify checksum of uploads in the tests, it would verify no off by one. Having read the unit tests, I think there\u0027s no worry. They have good coverage of these type of problems.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return self._read(sz)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_7137fdfe","line":100,"updated":"2017-01-06 18:49:23.000000000","message":"s/as much as/up to/ ?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        return self._read(sz)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_17a13af8","line":100,"in_reply_to":"ba5201f7_7137fdfe","updated":"2017-01-07 00:12:30.000000000","message":"Done","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_3446434f","line":101,"updated":"2017-01-06 18:49:23.000000000","message":"NOTE: Easy place for off by 1 error. Checksum verification after segment upload should verify this is correct.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"},{"line_number":105,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_947b6f7a","line":102,"updated":"2017-01-06 18:49:23.000000000","message":"The method appears to be resumable / start buffering from an offset, so would it be more correct to have remaining printed here not self.total?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"},{"line_number":105,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_f784b65e","line":102,"in_reply_to":"ba5201f7_947b6f7a","updated":"2017-01-07 00:12:30.000000000","message":"That\u0027s right Jesse. But I guess the intention was to let the user know via the debug message that a particular chunk with the size set by the user via the config opt \"swift_store_large_object_chunk_size\" was being buffered. And hide from the user, the details of the actual size of the chunk which could possibly be smaller than the \"swift_store_large_object_chunk_size\" due to the total image size and chunking.\nLet me know what you think.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"51eabf7eb77fc9109d48cc965209a0a66fce8bcf","unresolved":false,"context_lines":[{"line_number":99,"context_line":"    def _buffer(self):"},{"line_number":100,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":101,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":102,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        while True:"},{"line_number":105,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_eb166357","line":102,"in_reply_to":"ba5201f7_f784b65e","updated":"2017-01-09 16:31:28.000000000","message":"That\u0027s fair. I wonder if there\u0027s a case where you would see this message in the logs twice due to a resume somehow that would make one think two chunks were buffered vs just one. Also it\u0027s a debug message, so v0v. Maybe it\u0027s fine.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    # NOTE(belliott) seek and tell get used by python-swiftclient to \"reset\""},{"line_number":133,"context_line":"    # if there is a put_object error"},{"line_number":134,"context_line":"    def seek(self, offset):"},{"line_number":135,"context_line":"        # backup the stream to \u0027offset\u0027 and re-generate the checksum, verifier"},{"line_number":136,"context_line":"        LOG.debug(\"Seek from %s to %s\" % (self._tmpfile.tell(), offset))"},{"line_number":137,"context_line":"        # backing up, re-calculate the checksum, verifier"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_94fd2f70","line":134,"updated":"2017-01-06 18:49:23.000000000","message":"NOTE: Easy place for off by 1 error. Checksum verification after segment upload with retry should verify this is correct.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"8d810430b760325d9aa156c693fcc80af8be9e66","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        self.verifier_pos \u003d 0"},{"line_number":67,"context_line":"        self.verifier \u003d verifier"},{"line_number":68,"context_line":"        if self.verifier is None:"},{"line_number":69,"context_line":"            self.verifiers \u003d ()"},{"line_number":70,"context_line":"        elif isinstance(self.verifier, (tuple, list)):"},{"line_number":71,"context_line":"            self.verifiers \u003d tuple(self.verifier)"},{"line_number":72,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_4e7212af","line":69,"range":{"start_line":69,"start_character":11,"end_line":69,"end_character":26},"updated":"2017-01-09 20:35:50.000000000","message":"Why do we need this?","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"33f546cbe53a347f003baf75aaf0769787d2ee0c","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        self.verifier_pos \u003d 0"},{"line_number":67,"context_line":"        self.verifier \u003d verifier"},{"line_number":68,"context_line":"        if self.verifier is None:"},{"line_number":69,"context_line":"            self.verifiers \u003d ()"},{"line_number":70,"context_line":"        elif isinstance(self.verifier, (tuple, list)):"},{"line_number":71,"context_line":"            self.verifiers \u003d tuple(self.verifier)"},{"line_number":72,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_c6c34289","line":69,"range":{"start_line":69,"start_character":11,"end_line":69,"end_character":26},"in_reply_to":"ba5201f7_4e7212af","updated":"2017-01-10 00:50:28.000000000","message":"I retained this for L134. But I think we can do without a tuple and iteration but with a conditional check.","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"8d810430b760325d9aa156c693fcc80af8be9e66","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        # update the checksum"},{"line_number":130,"context_line":"        self.checksum.update(result)"},{"line_number":131,"context_line":"        # update the verifier with only the bytes it might have not seen"},{"line_number":132,"context_line":"        if self._tmpfile.tell() + len(result) \u003e self.verifier_pos:"},{"line_number":133,"context_line":"            to_verify \u003d result[self.verifier_pos - self._tmpfile.tell():]"},{"line_number":134,"context_line":"            for self.verifier in self.verifiers:"},{"line_number":135,"context_line":"                self.verifier.update(to_verify)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_b3da0516","line":132,"range":{"start_line":132,"start_character":11,"end_line":132,"end_character":65},"updated":"2017-01-09 20:35:50.000000000","message":"This seems off to me.\nIsn\u0027t \u0027len(result)\u0027 already included in \u0027tell\u0027 here because the read operation is performed already?\nWouldn\u0027t the following be sufficient?\n self._tmpfile.tell() \u003e self.verifier_pos","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"2ecf65b995afcf52260201a015747341c536b5a4","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        # update the checksum"},{"line_number":130,"context_line":"        self.checksum.update(result)"},{"line_number":131,"context_line":"        # update the verifier with only the bytes it might have not seen"},{"line_number":132,"context_line":"        if self._tmpfile.tell() + len(result) \u003e self.verifier_pos:"},{"line_number":133,"context_line":"            to_verify \u003d result[self.verifier_pos - self._tmpfile.tell():]"},{"line_number":134,"context_line":"            for self.verifier in self.verifiers:"},{"line_number":135,"context_line":"                self.verifier.update(to_verify)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_7b986f6b","line":132,"range":{"start_line":132,"start_character":11,"end_line":132,"end_character":65},"in_reply_to":"ba5201f7_b3da0516","updated":"2017-01-10 00:20:37.000000000","message":"We actually need to maintain the position before and after verifier update with respect to the chunk read instead of using tell(). Both need to be updated with \u0027result\u0027 respectively. This is because, in case of a seek operation, tell() will already point to the position up to which we wanna seek, resulting in the if condition in L132 to fail. So, after a seek operation our verifier wont be updated(partially reset) which is undesirable.","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"8d810430b760325d9aa156c693fcc80af8be9e66","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        self.checksum.update(result)"},{"line_number":131,"context_line":"        # update the verifier with only the bytes it might have not seen"},{"line_number":132,"context_line":"        if self._tmpfile.tell() + len(result) \u003e self.verifier_pos:"},{"line_number":133,"context_line":"            to_verify \u003d result[self.verifier_pos - self._tmpfile.tell():]"},{"line_number":134,"context_line":"            for self.verifier in self.verifiers:"},{"line_number":135,"context_line":"                self.verifier.update(to_verify)"},{"line_number":136,"context_line":"            self.verifier_pos +\u003d len(to_verify)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_4ef772f5","line":133,"range":{"start_line":133,"start_character":31,"end_line":133,"end_character":72},"updated":"2017-01-09 20:35:50.000000000","message":"Then change this to \n self._tmpfile.tell() - self.verifier_pos\n\nAm I missing anything here?","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"2ecf65b995afcf52260201a015747341c536b5a4","unresolved":false,"context_lines":[{"line_number":130,"context_line":"        self.checksum.update(result)"},{"line_number":131,"context_line":"        # update the verifier with only the bytes it might have not seen"},{"line_number":132,"context_line":"        if self._tmpfile.tell() + len(result) \u003e self.verifier_pos:"},{"line_number":133,"context_line":"            to_verify \u003d result[self.verifier_pos - self._tmpfile.tell():]"},{"line_number":134,"context_line":"            for self.verifier in self.verifiers:"},{"line_number":135,"context_line":"                self.verifier.update(to_verify)"},{"line_number":136,"context_line":"            self.verifier_pos +\u003d len(to_verify)"}],"source_content_type":"text/x-python","patch_set":23,"id":"ba5201f7_fbac5f8e","line":133,"range":{"start_line":133,"start_character":31,"end_line":133,"end_character":72},"in_reply_to":"ba5201f7_4ef772f5","updated":"2017-01-10 00:20:37.000000000","message":"When _read is invoked from seek(), \u0027result\u0027 will be updated based on the seek position. So I think we do not need this computation. Please correct me if this approach might be wrong.","commit_id":"5966a8451f4d1f579963ef8ff7fb233e2cea69b9"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"69d45ba195fe46eef3d153b1b8c7157bb41ebd11","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        self.checksum.update(result)"},{"line_number":128,"context_line":"        if self.verifier:"},{"line_number":129,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":130,"context_line":"            if self.position + len(result) \u003e self.verifier_position:"},{"line_number":131,"context_line":"                self.verifier.update(result)"},{"line_number":132,"context_line":"                self.verifier_position +\u003d len(result)"},{"line_number":133,"context_line":"            self.position +\u003d len(result)"},{"line_number":134,"context_line":"        return result"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    # NOTE(belliott) seek and tell get used by python-swiftclient to \"reset\""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5201f7_fa850fcf","line":133,"range":{"start_line":130,"start_character":11,"end_line":133,"end_character":40},"updated":"2017-01-10 17:28:34.000000000","message":"If we are not resetting self.position on seek, this will update the verifier twice for the same content. If you do reset self.position on seek, then it\u0027d behave exactly like \u0027tell\u0027. So, there may not be much value in maintaining self.position. \n\nI still believe we can use just tell to figure out when and when not to update the verifier like mentioned on the previous patchset.\n\nBasically, update verifier ONLY when the file pointer is ahead of verifier position. If the file pointer is ahead, the content between verifier position and file pointer position is not seen by the verifier. Just update that bit in the verifier.\n\nLet me know what you think.","commit_id":"7afea63f39e832b7deb874d8eb846ea0a8707a13"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"b5f1a87648124e5b999b0b2e1ec7cdde18998761","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        self.checksum.update(result)"},{"line_number":128,"context_line":"        if self.verifier:"},{"line_number":129,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":130,"context_line":"            if self.position + len(result) \u003e self.verifier_position:"},{"line_number":131,"context_line":"                self.verifier.update(result)"},{"line_number":132,"context_line":"                self.verifier_position +\u003d len(result)"},{"line_number":133,"context_line":"            self.position +\u003d len(result)"},{"line_number":134,"context_line":"        return result"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    # NOTE(belliott) seek and tell get used by python-swiftclient to \"reset\""}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5201f7_a33602b2","line":133,"range":{"start_line":130,"start_character":11,"end_line":133,"end_character":40},"in_reply_to":"ba5201f7_fa850fcf","updated":"2017-01-10 18:47:37.000000000","message":"Hemanth, I agree. I was trying to update the verifier accordingly on a seek operation. i.e., I was recalculating and redoing an update to the verifier until the byte position after a seek operation.\nI understand that this need not be done cos our main goal is to ensure that the verifier knows what it should at the end anyway.\nAlso in case of a failure, the entire file is discarded and we do not care about the verifier at that point. \nHowever, I just wanted to share the change in tests with you without using tell() and with using it [1]\nhttp://paste.openstack.org/show/594462/","commit_id":"7afea63f39e832b7deb874d8eb846ea0a8707a13"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74c635aec2ecb2c195405717119bb2a8abaf8a8c","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        if self.verifier:"},{"line_number":128,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":129,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":130,"context_line":"                self.verifier.update(result)"},{"line_number":131,"context_line":"                self.verifier_position +\u003d len(result)"},{"line_number":132,"context_line":"        return result"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_a6034241","line":130,"range":{"start_line":130,"start_character":16,"end_line":130,"end_character":44},"updated":"2017-01-11 15:06:14.000000000","message":"I think we\u0027d be better off if we update the verifier only with what it hasn\u0027t seen vs what is read from the file. In most cases, what the verifier hasn\u0027t seen and what is read from file may be the same. Albeit hypothetical, let\u0027s consider the following case:\n* We have buffered an image segment of size 100 bytes.\n* We read 10 bytes at a time usually.\n* We read 3 times successfully.\n* We read the 4th time but swiftclient failed to upload\n* swiftclient seeks back to 30.\n* At this time, our file pointer (fp) is at 30, verifier is at 40\n* swiftclient decides to read 5 bytes now and uploads successfully.\n* fp is at 35 and verifier at 40\n* Now, swiftclient decides to go back reading 10 bytes because uploads are succeeding again.\n* fp would be at 45 and verifier now decides to update itself.\n* Ideally, we would want the verifier to update itself with only the 5 bytes it hasn\u0027t seen. But, here it would update itself with content between 35 and 45.\n* This will lead to double counting the content 35 and 40.\n\nHowever artificial the above example maybe, the point here is that we don\u0027t control the seek offsets and read sizes. So, if the consumer decides to change them on the fly, we should be ready for it. If the offsets and read sizes are always constant, it may work as-is. But, I suggest changing it to the following:\n verify_from \u003d self.verifier_position - self._tmpfile.tell()\n self.verifier.update(result[verify_from:])","commit_id":"99cd8fd4d17a2172d3aa320d2050b14561e6ab35"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9693c3ae0a87ca9abb0155a5c96f12801d901812","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        if self.verifier:"},{"line_number":128,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":129,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":130,"context_line":"                self.verifier.update(result)"},{"line_number":131,"context_line":"                self.verifier_position +\u003d len(result)"},{"line_number":132,"context_line":"        return result"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_9d9be465","line":130,"range":{"start_line":130,"start_character":16,"end_line":130,"end_character":44},"in_reply_to":"ba5201f7_a6034241","updated":"2017-01-11 19:50:47.000000000","message":"Was not sure if the pattern of reading, seeking would change in the middle of an image upload to Swift. Like in our example: reading in bytes of 10 -\u003e switching to reading in bytes of 5 -\u003e then switching back to reading in bytes of 10.\nThough this may or may not always happen, ensuring that we read only the exact necessary is better as you suggest. Will update it.\nThanks Hemanth.","commit_id":"99cd8fd4d17a2172d3aa320d2050b14561e6ab35"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74c635aec2ecb2c195405717119bb2a8abaf8a8c","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":129,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":130,"context_line":"                self.verifier.update(result)"},{"line_number":131,"context_line":"                self.verifier_position +\u003d len(result)"},{"line_number":132,"context_line":"        return result"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    # NOTE(belliott) seek and tell get used by python-swiftclient to \"reset\""}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5201f7_068ececf","line":131,"range":{"start_line":131,"start_character":16,"end_line":131,"end_character":53},"updated":"2017-01-11 15:06:14.000000000","message":"similarly:\n self.verifier_position +\u003d abs(verify_from)","commit_id":"99cd8fd4d17a2172d3aa320d2050b14561e6ab35"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74afaf3e9e9831c6853c280edae157b6be8c57a5","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\u0027A directory on the glance node where image segments \u0027"},{"line_number":31,"context_line":"                      \u0027will be buffered briefly before they are uploaded to \u0027"},{"line_number":32,"context_line":"                      \u0027swift. This is required only when the config\u0027"},{"line_number":33,"context_line":"                      \u0027swift_buffer_on_upload is set to True.\u0027"},{"line_number":34,"context_line":"                      \u0027This directory should be provisioned keeping in mind \u0027"},{"line_number":35,"context_line":"                      \u0027the swift_store_large_object_chunk_size and the max. \u0027"},{"line_number":36,"context_line":"                      \u0027number of images that could be uploaded simultaneously \u0027"},{"line_number":37,"context_line":"                      \u0027by a given glance node.\u0027)),"},{"line_number":38,"context_line":"]"},{"line_number":39,"context_line":"CONF \u003d cfg.CONF"},{"line_number":40,"context_line":"CONF.register_opts(BUFFERING_OPTS, group\u003d\u0027glance_store\u0027)"}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_26495c32","line":37,"range":{"start_line":30,"start_character":22,"end_line":37,"end_character":47},"updated":"2017-01-13 18:43:49.000000000","message":"I didn\u0027t realize earlier that this help text is not in the new format we introduced last cycle. Let\u0027s get this into the new format.","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"4000433b7d0d6c2d037e266b461cda76c6a421aa","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\u0027A directory on the glance node where image segments \u0027"},{"line_number":31,"context_line":"                      \u0027will be buffered briefly before they are uploaded to \u0027"},{"line_number":32,"context_line":"                      \u0027swift. This is required only when the config\u0027"},{"line_number":33,"context_line":"                      \u0027swift_buffer_on_upload is set to True.\u0027"},{"line_number":34,"context_line":"                      \u0027This directory should be provisioned keeping in mind \u0027"},{"line_number":35,"context_line":"                      \u0027the swift_store_large_object_chunk_size and the max. \u0027"},{"line_number":36,"context_line":"                      \u0027number of images that could be uploaded simultaneously \u0027"},{"line_number":37,"context_line":"                      \u0027by a given glance node.\u0027)),"},{"line_number":38,"context_line":"]"},{"line_number":39,"context_line":"CONF \u003d cfg.CONF"},{"line_number":40,"context_line":"CONF.register_opts(BUFFERING_OPTS, group\u003d\u0027glance_store\u0027)"}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_b4b65688","line":37,"range":{"start_line":30,"start_character":22,"end_line":37,"end_character":47},"in_reply_to":"7a3c09a3_26495c32","updated":"2017-01-13 19:45:09.000000000","message":"Done","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74afaf3e9e9831c6853c280edae157b6be8c57a5","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":66,"context_line":"        self.verifier \u003d verifier"},{"line_number":67,"context_line":"        if verifier:"},{"line_number":68,"context_line":"            self.verifier \u003d verifier"},{"line_number":69,"context_line":"            self.verifier_position \u003d 0"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_06c5408d","line":68,"range":{"start_line":68,"start_character":11,"end_line":68,"end_character":36},"updated":"2017-01-13 18:43:49.000000000","message":"Guess we can drop this?","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"4000433b7d0d6c2d037e266b461cda76c6a421aa","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":66,"context_line":"        self.verifier \u003d verifier"},{"line_number":67,"context_line":"        if verifier:"},{"line_number":68,"context_line":"            self.verifier \u003d verifier"},{"line_number":69,"context_line":"            self.verifier_position \u003d 0"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_f4b0de8d","line":68,"range":{"start_line":68,"start_character":11,"end_line":68,"end_character":36},"in_reply_to":"7a3c09a3_06c5408d","updated":"2017-01-13 19:45:09.000000000","message":"Yeah. Done.","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6abb156356b17e78dee6fcc553b1435d8ac9caf7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_212e5843","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":34},"updated":"2017-01-16 19:15:11.000000000","message":"2017 OpenStack Foundation","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"f37e5636c8d31c4361532292dedc36f745d912c5","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_6142206a","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":34},"in_reply_to":"7a3c09a3_212e5843","updated":"2017-01-16 19:29:03.000000000","message":"Better to just drop the first two lines\n\nhttps://wiki.openstack.org/wiki/LegalIssuesFAQ#Copyright_Headers\n\nhttps://wiki.openstack.org/wiki/LegalIssuesFAQ#OpenStack_Foundation_Copyright_Headers","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_3ff7135a","line":1,"range":{"start_line":1,"start_character":0,"end_line":1,"end_character":34},"in_reply_to":"7a3c09a3_6142206a","updated":"2017-01-17 21:14:01.000000000","message":"Done","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"930248b3931415d7de0281e48075fdcebba6a373","unresolved":false,"context_lines":[{"line_number":26,"context_line":"READ_SZ \u003d 65536"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\"\"\""},{"line_number":31,"context_line":"Directory to buffer image segments before upload to Swift."},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_6d55b1f8","line":29,"range":{"start_line":29,"start_character":16,"end_line":29,"end_character":39},"updated":"2017-01-16 20:51:21.000000000","message":"I\u0027m wondering what if someone enables buffering but fails to set this option?\nDefault value comes to mind, but setting a default value for this option may have serious consequences.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":26,"context_line":"READ_SZ \u003d 65536"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"},{"line_number":30,"context_line":"               help\u003d_(\"\"\""},{"line_number":31,"context_line":"Directory to buffer image segments before upload to Swift."},{"line_number":32,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_bfb86376","line":29,"range":{"start_line":29,"start_character":16,"end_line":29,"end_character":39},"in_reply_to":"7a3c09a3_6d55b1f8","updated":"2017-01-17 21:14:01.000000000","message":"Added logic to perform checks on whether a not None and valid path is given to this option is swift/store.py. If not, suitable exceptions will be raised.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"930248b3931415d7de0281e48075fdcebba6a373","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.verifier_position \u003d 0"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"},{"line_number":86,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":87,"context_line":"        self._buffered \u003d False"},{"line_number":88,"context_line":"        self._buffer()"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_4dd7154b","line":86,"range":{"start_line":86,"start_character":24,"end_line":86,"end_character":62},"updated":"2017-01-16 20:51:21.000000000","message":"Also, this will throw an error if a valid path isn\u0027t provided.\nWe should probably handle the exception and raise it.\n\nTime to introduce FilePathOpt in oslo.config? :)","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.verifier_position \u003d 0"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"},{"line_number":86,"context_line":"        self._tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":87,"context_line":"        self._buffered \u003d False"},{"line_number":88,"context_line":"        self._buffer()"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_7f1efb70","line":86,"range":{"start_line":86,"start_character":24,"end_line":86,"end_character":62},"in_reply_to":"7a3c09a3_4dd7154b","updated":"2017-01-17 21:14:01.000000000","message":"Handling this in swift/store.py too.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":20382,"name":"YuYang","email":"yuyangwang1985@gmail.com","username":"YuYangWang"},"change_message_id":"ebca4cc1d31a28754c306d55e574643dd5f6d4a3","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _buffer(self):"},{"line_number":113,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":114,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":115,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        while True:"},{"line_number":118,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_0f4a5a55","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":69},"updated":"2017-01-17 02:05:00.000000000","message":"i think this should add remaining in the log.thanks!","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"c369e66f4e272bdaaab16a8c648c37ff61087dc1","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _buffer(self):"},{"line_number":113,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":114,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":115,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        while True:"},{"line_number":118,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_eec7b095","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":69},"in_reply_to":"7a3c09a3_0f4a5a55","updated":"2017-01-17 15:46:28.000000000","message":"+1, good catch","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _buffer(self):"},{"line_number":113,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":114,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":115,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        while True:"},{"line_number":118,"context_line":"            read_sz \u003d min(remaining, READ_SZ)"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_4ab41b34","line":115,"range":{"start_line":115,"start_character":8,"end_line":115,"end_character":69},"in_reply_to":"7a3c09a3_eec7b095","updated":"2017-01-17 21:14:01.000000000","message":"I think we are intentionally hiding from the user the details of the \"remaining\" size here. And just letting the user know that the chunk_size set is currently being buffered.\nSee comment on L102 in PS21.\nI will change it to remaining if you think it is more accurate.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":20382,"name":"YuYang","email":"yuyangwang1985@gmail.com","username":"YuYangWang"},"change_message_id":"ebca4cc1d31a28754c306d55e574643dd5f6d4a3","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @property"},{"line_number":171,"context_line":"    def bytes_read(self):"},{"line_number":172,"context_line":"        # just used for debug logging"},{"line_number":173,"context_line":"        return self.tell()"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_af2306a6","line":172,"range":{"start_line":172,"start_character":8,"end_line":172,"end_character":37},"updated":"2017-01-17 02:05:00.000000000","message":"where is debug log?","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"c369e66f4e272bdaaab16a8c648c37ff61087dc1","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @property"},{"line_number":171,"context_line":"    def bytes_read(self):"},{"line_number":172,"context_line":"        # just used for debug logging"},{"line_number":173,"context_line":"        return self.tell()"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_cec03453","line":172,"range":{"start_line":172,"start_character":8,"end_line":172,"end_character":37},"in_reply_to":"7a3c09a3_af2306a6","updated":"2017-01-17 15:46:28.000000000","message":"Guess we can drop it, not relevant any more.\nInitially this was just used to log the number of bytes read in the driver code. But, that\u0027s not true, it is used in keep track of the upload progress. So, we can drop the comment.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    @property"},{"line_number":171,"context_line":"    def bytes_read(self):"},{"line_number":172,"context_line":"        # just used for debug logging"},{"line_number":173,"context_line":"        return self.tell()"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def __enter__(self):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_4a189b75","line":172,"range":{"start_line":172,"start_character":8,"end_line":172,"end_character":37},"in_reply_to":"7a3c09a3_cec03453","updated":"2017-01-17 21:14:01.000000000","message":"Done","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"b3deffc476cdc9189a1bb5a1c56b1c5167918252","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from glance_store.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":"READ_SZ \u003d 65536"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_df5c01f3","line":22,"updated":"2017-01-18 23:16:54.000000000","message":"Perhaps I missed it. Did we discuss why this is the default size vs say the typical default page size of 4096? Also, why is this global?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"380d6f4e3e66130c451cdfc46761ed21a62dd3e7","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from glance_store.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":"READ_SZ \u003d 65536"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_f23e27b7","line":22,"in_reply_to":"5a3905b3_1f2caa49","updated":"2017-01-19 23:30:02.000000000","message":"From what I know, it is the default chunk_size that swiftclient uses to read and write. There maybe other reasons that I\u0027m unaware of.\n\nIt is global here because it need not be initialized for every instance of BufferedReader. If we are religious about using global variables, we can maybe make it a class variable.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from glance_store.i18n import _"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":22,"context_line":"READ_SZ \u003d 65536"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":25,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_1f2caa49","line":22,"in_reply_to":"7a3c09a3_df5c01f3","updated":"2017-01-19 21:01:20.000000000","message":"Hemanth, can you please reply to this as this was added at the early stages of the implementation?\nI am not exactly sure how the conclusion was done. I think ChunkReader uploads the segments to swift in size of ~6 kb and hence this decision for the size to read here in BufferedReader.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"b3deffc476cdc9189a1bb5a1c56b1c5167918252","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    Chunks are temporarily buffered to disk.  Disk space consumed will be"},{"line_number":60,"context_line":"    roughly (segment size * number of in-flight upload requests)."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    WARNING:"},{"line_number":63,"context_line":"    There exists a possibility where the disk space consumed for buffering MAY"},{"line_number":64,"context_line":"    eat into the disk space available for glance cache. This may affect image"},{"line_number":65,"context_line":"    download performance. So, extra care should be taken while deploying this"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_df2401b4","line":62,"updated":"2017-01-18 23:16:54.000000000","message":"I believe I mentioned this before: we should probably remove the word WARNING here. You don\u0027t WARN developers of a deployer / operator impact. The description is fine for awareness. We should, however, ensure that this is clear in the deployer / operator docs.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    Chunks are temporarily buffered to disk.  Disk space consumed will be"},{"line_number":60,"context_line":"    roughly (segment size * number of in-flight upload requests)."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    WARNING:"},{"line_number":63,"context_line":"    There exists a possibility where the disk space consumed for buffering MAY"},{"line_number":64,"context_line":"    eat into the disk space available for glance cache. This may affect image"},{"line_number":65,"context_line":"    download performance. So, extra care should be taken while deploying this"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_eb61fba9","line":62,"in_reply_to":"7a3c09a3_df2401b4","updated":"2017-01-19 21:01:20.000000000","message":"Sure. Apologies for missing to update it in the previous PS.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self.total \u003d total"},{"line_number":72,"context_line":"        # Maintain copy of the initial checksum to use, in case of a seek"},{"line_number":73,"context_line":"        # operation."},{"line_number":74,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":75,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":76,"context_line":"        self.verifier \u003d verifier"},{"line_number":77,"context_line":"        if self.verifier:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_5fe65117","line":74,"updated":"2017-01-19 00:34:16.000000000","message":"I\u0027m kinda in favor of treating the checksum obj like we do the verifier: update it only when there\u0027s data that hasn\u0027t been seen. Then seek is just a proxy to self._tmpfile.seek (like tell) and _read can be rolled into read (since there are no other callers).","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        self.total \u003d total"},{"line_number":72,"context_line":"        # Maintain copy of the initial checksum to use, in case of a seek"},{"line_number":73,"context_line":"        # operation."},{"line_number":74,"context_line":"        self._initial_checksum \u003d initial_checksum.copy()"},{"line_number":75,"context_line":"        self.checksum \u003d initial_checksum"},{"line_number":76,"context_line":"        self.verifier \u003d verifier"},{"line_number":77,"context_line":"        if self.verifier:"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_3f6326b3","line":74,"in_reply_to":"7a3c09a3_5fe65117","updated":"2017-01-19 21:01:20.000000000","message":"Agreed. Treating the checksum like the verifier clears the code a whole lot, adding more clarity.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self._buffered \u003d False"},{"line_number":84,"context_line":"        self._buffer()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # Reading the first byte to check if the current chunk is zero-sized"},{"line_number":87,"context_line":"        if self._buffered and len(self._tmpfile.read(1)) \u003d\u003d 0:"},{"line_number":88,"context_line":"            self.is_zero_size \u003d True"},{"line_number":89,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_5cdadfea","line":86,"updated":"2017-01-19 00:34:16.000000000","message":"I think it\u0027d be a bit cleaner to have\n\n self.is_zero_size \u003d True\n self._buffer()\n\nhere, then down in _buffer include\n\n self.is_zero_size \u003d False\n\njust before writing to self._tmpfile. Less I/O \u003d\u003d happier server.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        self._buffered \u003d False"},{"line_number":84,"context_line":"        self._buffer()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # Reading the first byte to check if the current chunk is zero-sized"},{"line_number":87,"context_line":"        if self._buffered and len(self._tmpfile.read(1)) \u003d\u003d 0:"},{"line_number":88,"context_line":"            self.is_zero_size \u003d True"},{"line_number":89,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_8b05d715","line":86,"in_reply_to":"7a3c09a3_5cdadfea","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"b3deffc476cdc9189a1bb5a1c56b1c5167918252","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        self._buffer()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # Reading the first byte to check if the current chunk is zero-sized"},{"line_number":87,"context_line":"        if self._buffered and len(self._tmpfile.read(1)) \u003d\u003d 0:"},{"line_number":88,"context_line":"            self.is_zero_size \u003d True"},{"line_number":89,"context_line":"        else:"},{"line_number":90,"context_line":"            self.is_zero_size \u003d False"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_3fafc595","line":87,"updated":"2017-01-18 23:16:54.000000000","message":"Why are we checking if self._buffered? We self._buffer() right before this which only has two exits: an exception that would be raised or self._buffered \u003d True; return None.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        self._buffer()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        # Reading the first byte to check if the current chunk is zero-sized"},{"line_number":87,"context_line":"        if self._buffered and len(self._tmpfile.read(1)) \u003d\u003d 0:"},{"line_number":88,"context_line":"            self.is_zero_size \u003d True"},{"line_number":89,"context_line":"        else:"},{"line_number":90,"context_line":"            self.is_zero_size \u003d False"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_1a7920fd","line":87,"in_reply_to":"7a3c09a3_3fafc595","updated":"2017-01-19 21:01:20.000000000","message":"You are right Jesse. We need not do this check. Addressing this concern with Tim\u0027s suggestion above.\nAlso, I think we can get rid of self.is_zero_size.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        file buffer.  Then return data out of that buffer."},{"line_number":97,"context_line":"        \"\"\""},{"line_number":98,"context_line":"        # First buffer as much as the full chunk size."},{"line_number":99,"context_line":"        if not self._buffered:"},{"line_number":100,"context_line":"            self._buffer()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        # Now playback out of that buffer to the caller"},{"line_number":103,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_5ffab143","line":100,"range":{"start_line":99,"start_character":8,"end_line":100,"end_character":26},"updated":"2017-01-19 21:01:20.000000000","message":"We can avoid call to _buffer() here if we directly buffer only if self._buffered is False.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"b3deffc476cdc9189a1bb5a1c56b1c5167918252","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        return self._read(sz)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _buffer(self):"},{"line_number":109,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":110,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":111,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_023b8c9d","line":108,"updated":"2017-01-18 23:16:54.000000000","message":"It occurs to me that calling _buffer() twice is dangerous because it reads from the fd and seeks on the tmpfile which is not desirable. Therefore, we need to check before we call it. That\u0027s cognitive overhead for the developer.\n\nWould it be safer to refactor that check into this method instead of requiring the developer calling it to make it outside the call? Then the call to _buffer can be made at any point without having to worry if the data is already buffered.\n\nThis can be achieved by putting the check at the top of the method, or making the while, while not self._buffered, and moving the two lines at the bottom within the while loop under if len(buf) \u003d\u003d 0: check.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        return self._read(sz)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _buffer(self):"},{"line_number":109,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":110,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":111,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_eeb0098e","line":108,"in_reply_to":"7a3c09a3_023b8c9d","updated":"2017-01-19 21:01:20.000000000","message":"We can actually invoke _buffer() just once in the constructor andM\\ making sure that we buffer only if self._buffered is False would solve the concern I guess?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _buffer(self):"},{"line_number":109,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":110,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":111,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_dcb40fd6","line":110,"updated":"2017-01-19 00:34:16.000000000","message":"Seems like we could save a syscall and just say\n\n remaining \u003d self.total","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _buffer(self):"},{"line_number":109,"context_line":"        # buffer as much as the remainder of the chunk"},{"line_number":110,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":111,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % self.total)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_cb2fdfa5","line":110,"in_reply_to":"7a3c09a3_dcb40fd6","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            except IOError as e:"},{"line_number":118,"context_line":"                # We actually don\u0027t know what exactly self.fd is. And as a"},{"line_number":119,"context_line":"                # result we don\u0027t know which exception it may raise. To pass"},{"line_number":120,"context_line":"                # the retry mechanism inside swift client we must limit the"},{"line_number":121,"context_line":"                # possible set of errors."},{"line_number":122,"context_line":"                raise socket.error(*e.args)"},{"line_number":123,"context_line":"            if len(buf) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_fc92ab4a","line":120,"range":{"start_line":120,"start_character":18,"end_line":120,"end_character":57},"updated":"2017-01-19 00:34:16.000000000","message":"If we fail to read from self.fd, is there any point in retrying the swift upload? Won\u0027t it either error out again or send only *part* of what the client intended to send?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            except IOError as e:"},{"line_number":118,"context_line":"                # We actually don\u0027t know what exactly self.fd is. And as a"},{"line_number":119,"context_line":"                # result we don\u0027t know which exception it may raise. To pass"},{"line_number":120,"context_line":"                # the retry mechanism inside swift client we must limit the"},{"line_number":121,"context_line":"                # possible set of errors."},{"line_number":122,"context_line":"                raise socket.error(*e.args)"},{"line_number":123,"context_line":"            if len(buf) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_8b2eb7a3","line":120,"range":{"start_line":120,"start_character":18,"end_line":120,"end_character":57},"in_reply_to":"7a3c09a3_fc92ab4a","updated":"2017-01-19 21:01:20.000000000","message":"True. Makes sense to avoid retries.\nWanted to know what others think too.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                raise socket.error(*e.args)"},{"line_number":123,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":124,"context_line":"                break"},{"line_number":125,"context_line":"            else:"},{"line_number":126,"context_line":"                self._tmpfile.write(buf)"},{"line_number":127,"context_line":"                remaining -\u003d len(buf)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_3fcee5b4","line":125,"updated":"2017-01-19 00:34:16.000000000","message":"nit: because of the break, the else is unnecessary.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                raise socket.error(*e.args)"},{"line_number":123,"context_line":"            if len(buf) \u003d\u003d 0:"},{"line_number":124,"context_line":"                break"},{"line_number":125,"context_line":"            else:"},{"line_number":126,"context_line":"                self._tmpfile.write(buf)"},{"line_number":127,"context_line":"                remaining -\u003d len(buf)"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_2bece38e","line":125,"in_reply_to":"7a3c09a3_3fcee5b4","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        if self.verifier:"},{"line_number":138,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":139,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":140,"context_line":"                verify \u003d self.verifier_position - self._tmpfile.tell()"},{"line_number":141,"context_line":"                self.verifier.update(result[verify:])"},{"line_number":142,"context_line":"                self.verifier_position +\u003d abs(verify)"},{"line_number":143,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_8592269e","line":140,"updated":"2017-01-19 00:34:16.000000000","message":"Another opportunity to save a syscall:\n\n verify \u003d self.verifier_position - self._tmpfile.tell()\n if verify \u003c 0:\n     ...","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"2d1ff4d3937a3c69ca02ae3777f60fdc9b6f4375","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        if self.verifier:"},{"line_number":138,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":139,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":140,"context_line":"                verify \u003d self.verifier_position - self._tmpfile.tell()"},{"line_number":141,"context_line":"                self.verifier.update(result[verify:])"},{"line_number":142,"context_line":"                self.verifier_position +\u003d abs(verify)"},{"line_number":143,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_0b7aa224","line":140,"in_reply_to":"5a3905b3_4bb74a39","updated":"2017-01-19 22:34:30.000000000","message":"Ahh okay. Thanks TIm.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"bfe789e699b16745a83ccbeac06c78d7b88c46fa","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        if self.verifier:"},{"line_number":138,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":139,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":140,"context_line":"                verify \u003d self.verifier_position - self._tmpfile.tell()"},{"line_number":141,"context_line":"                self.verifier.update(result[verify:])"},{"line_number":142,"context_line":"                self.verifier_position +\u003d abs(verify)"},{"line_number":143,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_4bb74a39","line":140,"in_reply_to":"7a3c09a3_0be727ad","updated":"2017-01-19 21:29:13.000000000","message":"Sorry, I wasn\u0027t clear; I meant to replace both lines. With more context,\n\n if self.verifier:\n     verify \u003d self.verifier_position - self._tmpfile.tell()\n     if verify \u003c 0:\n         self.verifier.update(result[verify:])\n         self.verifier_position +\u003d abs(verify)\n\n...just to save the extra tell call.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        if self.verifier:"},{"line_number":138,"context_line":"            # update the verifier with only the bytes it has not seen"},{"line_number":139,"context_line":"            if self._tmpfile.tell() \u003e self.verifier_position:"},{"line_number":140,"context_line":"                verify \u003d self.verifier_position - self._tmpfile.tell()"},{"line_number":141,"context_line":"                self.verifier.update(result[verify:])"},{"line_number":142,"context_line":"                self.verifier_position +\u003d abs(verify)"},{"line_number":143,"context_line":"        return result"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_0be727ad","line":140,"in_reply_to":"7a3c09a3_8592269e","updated":"2017-01-19 21:01:20.000000000","message":"Wont verify always be \u003c 0 due to the check in L139?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":174,"context_line":"        # close and delete the temporary file used to buffer data"},{"line_number":175,"context_line":"        self._tmpfile.close()"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_9fb8b92c","line":175,"updated":"2017-01-19 00:34:16.000000000","message":"Maybe worth implementing the context manager as\n\n def __enter__(self):\n     self._tmpfile.__enter__()\n     return self\n\n def __exit__(self, type, value, traceback):\n     self._tmpfile.__exit__(type, value, traceback)\n\n?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":174,"context_line":"        # close and delete the temporary file used to buffer data"},{"line_number":175,"context_line":"        self._tmpfile.close()"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_5612b659","line":175,"in_reply_to":"7a3c09a3_9fb8b92c","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"15c59ef52cfca0e41471e853efad35c0803fffd3","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        to_buffer \u003d self.total"},{"line_number":104,"context_line":"        LOG.debug(\"Buffering %s bytes of image segment\" % to_buffer)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        if not self._buffered:"},{"line_number":107,"context_line":"            read_sz \u003d min(to_buffer, READ_SZ)"},{"line_number":108,"context_line":"            try:"},{"line_number":109,"context_line":"                buf \u003d self.fd.read(read_sz)"}],"source_content_type":"text/x-python","patch_set":36,"id":"5a3905b3_cb0eda33","line":106,"updated":"2017-01-19 21:29:23.000000000","message":"Wait, where\u0027d our loop go?","commit_id":"f3381cba34f905bd1187dd62d2f5f0fd3b8a3d25"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"15c59ef52cfca0e41471e853efad35c0803fffd3","unresolved":false,"context_lines":[{"line_number":109,"context_line":"                buf \u003d self.fd.read(read_sz)"},{"line_number":110,"context_line":"            except IOError as e:"},{"line_number":111,"context_line":"                # raise error on failure to read from fd"},{"line_number":112,"context_line":"                raise socket.error(*e.args)"},{"line_number":113,"context_line":"            else:"},{"line_number":114,"context_line":"                self._tmpfile.write(buf)"},{"line_number":115,"context_line":"                to_buffer -\u003d len(buf)"}],"source_content_type":"text/x-python","patch_set":36,"id":"5a3905b3_28304401","line":112,"updated":"2017-01-19 21:29:23.000000000","message":"As long as we\u0027re still raising it as a socket.error, I think we should leave the comment about how swiftclient will retry. If we decide that\u0027s undesirable, I think the whole try/except can be dropped.","commit_id":"f3381cba34f905bd1187dd62d2f5f0fd3b8a3d25"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"1e81e0bcca16b2f5499ee76e7025f3981743efe4","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            read_sz \u003d min(to_buffer, READ_SZ)"},{"line_number":108,"context_line":"            try:"},{"line_number":109,"context_line":"                buf \u003d self.fd.read(read_sz)"},{"line_number":110,"context_line":"            except IOError as e:"},{"line_number":111,"context_line":"                # We actually don\u0027t know what exactly self.fd is. And as a"},{"line_number":112,"context_line":"                # result we don\u0027t know which exception it may raise. To pass"},{"line_number":113,"context_line":"                # the retry mechanism inside swift client we must limit the"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_e0e8d512","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":32},"updated":"2017-01-20 21:34:06.000000000","message":"Wondering if we need to limit the catch only to raise a socket.error. As Tim says, retrying the read might only error out again and keep trying.\nMaybe we should not limit it to just this error?\nNeed opinion on this.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"ad33784c85b6279125bd9e4176677cdc139332f5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            read_sz \u003d min(to_buffer, READ_SZ)"},{"line_number":108,"context_line":"            try:"},{"line_number":109,"context_line":"                buf \u003d self.fd.read(read_sz)"},{"line_number":110,"context_line":"            except IOError as e:"},{"line_number":111,"context_line":"                # We actually don\u0027t know what exactly self.fd is. And as a"},{"line_number":112,"context_line":"                # result we don\u0027t know which exception it may raise. To pass"},{"line_number":113,"context_line":"                # the retry mechanism inside swift client we must limit the"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_0f5fcae5","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":32},"in_reply_to":"5a3905b3_e0e8d512","updated":"2017-01-21 00:25:49.000000000","message":"Not sure. I\u0027d test it.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9eaac6bf4dfeeb2dc3451d0cc6e16910859ef561","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.total \u003d total"},{"line_number":71,"context_line":"        self.checksum \u003d checksum"},{"line_number":72,"context_line":"        self.verifier \u003d verifier"},{"line_number":73,"context_line":"        # maintain a pointer to use, for updating checksum, verifier"},{"line_number":74,"context_line":"        self.update_position \u003d 0"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_94bc65bc","line":73,"range":{"start_line":73,"start_character":10,"end_line":73,"end_character":68},"updated":"2017-01-23 20:50:29.000000000","message":"NIT: maintain a pointer to update checksum and verifier","commit_id":"4bfc75aed47c53620cacbe4e0efe705a34f09833"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"ac6e7ff39a0558dc3effb32ca138d77ee4ce3921","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self.total \u003d total"},{"line_number":71,"context_line":"        self.checksum \u003d checksum"},{"line_number":72,"context_line":"        self.verifier \u003d verifier"},{"line_number":73,"context_line":"        # maintain a pointer to use, for updating checksum, verifier"},{"line_number":74,"context_line":"        self.update_position \u003d 0"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        buffer_dir \u003d CONF.glance_store.swift_upload_buffer_dir"}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_ad32f0a4","line":73,"range":{"start_line":73,"start_character":10,"end_line":73,"end_character":68},"in_reply_to":"5a3905b3_94bc65bc","updated":"2017-01-23 21:57:15.000000000","message":"Done","commit_id":"4bfc75aed47c53620cacbe4e0efe705a34f09833"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9eaac6bf4dfeeb2dc3451d0cc6e16910859ef561","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        file buffer.  Then return data out of that buffer."},{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":89,"context_line":"        request_sz \u003d min(remaining, sz)"},{"line_number":90,"context_line":"        # read out of the buffered chunk"},{"line_number":91,"context_line":"        result \u003d self._tmpfile.read(request_sz)"},{"line_number":92,"context_line":"        # update the checksum and verifier with only the bytes"}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_f74e8b39","line":89,"range":{"start_line":89,"start_character":8,"end_line":89,"end_character":18},"updated":"2017-01-23 20:50:29.000000000","message":"This isn\u0027t an appropriate name. For sake of clarity, call it read_length, data_sz, data_length or whatever but request_sz doesn\u0027t make sense in my opinion. There is no \"request\" here.","commit_id":"4bfc75aed47c53620cacbe4e0efe705a34f09833"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"ac6e7ff39a0558dc3effb32ca138d77ee4ce3921","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        file buffer.  Then return data out of that buffer."},{"line_number":87,"context_line":"        \"\"\""},{"line_number":88,"context_line":"        remaining \u003d self.total - self._tmpfile.tell()"},{"line_number":89,"context_line":"        request_sz \u003d min(remaining, sz)"},{"line_number":90,"context_line":"        # read out of the buffered chunk"},{"line_number":91,"context_line":"        result \u003d self._tmpfile.read(request_sz)"},{"line_number":92,"context_line":"        # update the checksum and verifier with only the bytes"}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_cd257c5c","line":89,"range":{"start_line":89,"start_character":8,"end_line":89,"end_character":18},"in_reply_to":"5a3905b3_f74e8b39","updated":"2017-01-23 21:57:15.000000000","message":"Done","commit_id":"4bfc75aed47c53620cacbe4e0efe705a34f09833"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"b5abdb107d990cf6d1fe74dc0a178c5cae59d31a","unresolved":false,"context_lines":[{"line_number":21,"context_line":"from glance_store.i18n import _"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":"READ_SZ \u003d 65536"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"BUFFERING_OPTS \u003d ["},{"line_number":27,"context_line":"    cfg.StrOpt(\u0027swift_upload_buffer_dir\u0027,"}],"source_content_type":"text/x-python","patch_set":42,"id":"7f287b81_964efb35","line":24,"range":{"start_line":24,"start_character":5,"end_line":24,"end_character":7},"updated":"2017-09-07 10:55:22.000000000","message":"Lets expand these for readability before releasing.","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"b5abdb107d990cf6d1fe74dc0a178c5cae59d31a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        # Setting the file pointer back to the beginning of file"},{"line_number":108,"context_line":"        self._tmpfile.seek(0)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def read(self, sz):"},{"line_number":111,"context_line":"        \"\"\"Read up to a chunk\u0027s worth of data from the input stream into a"},{"line_number":112,"context_line":"        file buffer.  Then return data out of that buffer."},{"line_number":113,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":42,"id":"7f287b81_566653c3","line":110,"range":{"start_line":110,"start_character":19,"end_line":110,"end_character":21},"updated":"2017-09-07 10:55:22.000000000","message":"ditto expand","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"}],"glance_store/_drivers/swift/store.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"732c08927891ce32f51ee1bb8b3b6b85800734eb","unresolved":false,"context_lines":[{"line_number":512,"context_line":"                    reader \u003d self.reader_class(image_file, checksum,"},{"line_number":513,"context_line":"                                               chunk_size)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"                    reader \u003d ChunkReader(image_file, checksum, chunk_size)"},{"line_number":516,"context_line":"                    try:"},{"line_number":517,"context_line":"                        chunk_etag \u003d connection.put_object("},{"line_number":518,"context_line":"                            location.container, chunk_name, reader,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa98f980_4633d961","line":515,"updated":"2014-09-11 20:12:28.000000000","message":"don\u0027t you need to delete this line?","commit_id":"bf888f62376cb7101a1ef582b3f5cb2484ef7234"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6c96a8ff4ad394ce51f42c73fc42501f8a89dcf8","unresolved":false,"context_lines":[{"line_number":502,"context_line":"                        content_length \u003d chunk_size"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"                    chunk_name \u003d \"%s-%05d\" % (location.obj, chunk_id)"},{"line_number":505,"context_line":"                    reader \u003d ChunkReader(image_file, checksum, chunk_size)"},{"line_number":506,"context_line":"                    try:"},{"line_number":507,"context_line":"                        chunk_etag \u003d connection.put_object("},{"line_number":508,"context_line":"                            location.container, chunk_name, reader,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa98f980_1cf044fd","side":"PARENT","line":505,"updated":"2014-09-11 20:14:58.000000000","message":"So, it looks good this line being removed from PS2.","commit_id":"560f244a3982449c71189abde40b8093019dccc2"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"c47acabab47d23a169630bb7d107095036a72e5f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from glance_store import i18n"},{"line_number":34,"context_line":"from glance_store import location"},{"line_number":35,"context_line":"from glance_store.openstack.common import excutils"},{"line_number":36,"context_line":"from glance_store.openstack.common import importutils"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_ \u003d i18n._"},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_d28d647e","line":36,"updated":"2014-09-16 09:42:16.000000000","message":"importutils is deprecated in oslo-inc, please don\u0027t use it","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"37f1c4f5088cfe0b3ec06f00b8ab236afc98baab","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from glance_store import i18n"},{"line_number":34,"context_line":"from glance_store import location"},{"line_number":35,"context_line":"from glance_store.openstack.common import excutils"},{"line_number":36,"context_line":"from glance_store.openstack.common import importutils"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_ \u003d i18n._"},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a28eaace","line":36,"in_reply_to":"fa98f980_cf3bf2c6","updated":"2014-09-17 11:01:38.000000000","message":"It\u0027s actually on its way to deprecation, it\u0027s recommended to use stevedore instead. We\u0027ve re-exported all the importutils methods in oslo.utils but they\u0027ll go away in the future.\n\nEither way, it\u0027d be cool if you could use oslo.utils instead. :D","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"944f16e8d52fa7feb5de6e925ccfdeb0c6253d31","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from glance_store import i18n"},{"line_number":34,"context_line":"from glance_store import location"},{"line_number":35,"context_line":"from glance_store.openstack.common import excutils"},{"line_number":36,"context_line":"from glance_store.openstack.common import importutils"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"_ \u003d i18n._"},{"line_number":39,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_cf3bf2c6","line":36,"in_reply_to":"fa98f980_d28d647e","updated":"2014-09-16 15:13:29.000000000","message":"I assume you mean use oslo.utils?  I will update it.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"c47acabab47d23a169630bb7d107095036a72e5f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":101,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":102,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027swift_store_reader_class\u0027,"},{"line_number":104,"context_line":"               default\u003d\u0027glance_store._drivers.swift.store.ChunkReader\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\u0027Reader class for processing the input file stream on \u0027"},{"line_number":106,"context_line":"                      \u0027uploads.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_3285d059","line":103,"updated":"2014-09-16 09:42:16.000000000","message":"Why do we need to make the reader class configurable? Can\u0027t we just have one and use that?","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"944f16e8d52fa7feb5de6e925ccfdeb0c6253d31","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":101,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":102,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027swift_store_reader_class\u0027,"},{"line_number":104,"context_line":"               default\u003d\u0027glance_store._drivers.swift.store.ChunkReader\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\u0027Reader class for processing the input file stream on \u0027"},{"line_number":106,"context_line":"                      \u0027uploads.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_7ce646b2","line":103,"in_reply_to":"fa98f980_3285d059","updated":"2014-09-16 15:13:29.000000000","message":"We could.  The in-memory buffering may be undesirable for some deployments that want to maintain a tighter memory footprint.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"37f1c4f5088cfe0b3ec06f00b8ab236afc98baab","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":101,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":102,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027swift_store_reader_class\u0027,"},{"line_number":104,"context_line":"               default\u003d\u0027glance_store._drivers.swift.store.ChunkReader\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\u0027Reader class for processing the input file stream on \u0027"},{"line_number":106,"context_line":"                      \u0027uploads.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_e24d129b","line":103,"in_reply_to":"fa98f980_7ce646b2","updated":"2014-09-17 11:01:38.000000000","message":"I\u0027d probably go with just 1 buffer implementation for now. Not sure what others think about this, though. It feels like we\u0027re going against YAGNI here.\n\nOne more question. What happens if someone does not want the in-memory buffer. It doesn\u0027t seem there\u0027s a way to disable this right now. I know disabling it basically means reviving the bug it tries to fix but not having a way to do so forces users to always use the in-memory buffer unless the write their own.\n\nAll this makes me think that probably going with just 1 for now w/o config options is better.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"cdcf4df7ffa3a3a99d03c2f73dab885b0e2e529b","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":101,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":102,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":103,"context_line":"    cfg.StrOpt(\u0027swift_store_reader_class\u0027,"},{"line_number":104,"context_line":"               default\u003d\u0027glance_store._drivers.swift.store.ChunkReader\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\u0027Reader class for processing the input file stream on \u0027"},{"line_number":106,"context_line":"                      \u0027uploads.\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_0bf6ae90","line":103,"in_reply_to":"fa98f980_e24d129b","updated":"2014-09-17 14:47:29.000000000","message":"The one reader path could be okay if the system defaults to a reasonably small value for the swift chunk size.  It currently defaults to 200MB, so the memory usage would be on the order of (200MB * num_of_uploads_in_progress).  Is there any sort of governor on the number of simultaneous uploads to swift?  (I think not)","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e9cfd97c68a8f727bbe7e96777abc989db878b81","unresolved":false,"context_lines":[{"line_number":547,"context_line":""},{"line_number":548,"context_line":"                    chunk_id +\u003d 1"},{"line_number":549,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":550,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":553,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_334ecb38","line":550,"updated":"2014-09-15 16:45:20.000000000","message":"Unused? Line 570 is also changed to call reader.checksum.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"944f16e8d52fa7feb5de6e925ccfdeb0c6253d31","unresolved":false,"context_lines":[{"line_number":547,"context_line":""},{"line_number":548,"context_line":"                    chunk_id +\u003d 1"},{"line_number":549,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":550,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":553,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_3c483e8a","line":550,"in_reply_to":"fa98f980_334ecb38","updated":"2014-09-16 15:13:29.000000000","message":"It seeds the checksum fed to self.reader_class() on the next iteration of the while loop.  \n\nIf an error occurred and seek() was called by swiftclient to backup the input stream, then the checksum would have been re-calculated.  This makes sure the updated checksum object is used.  It\u0027s a little ugly and non-obvious - I\u0027m not sure the best means to make it clearer.","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f31c7336aaa3ad670479c1770553c69037ce725a","unresolved":false,"context_lines":[{"line_number":547,"context_line":""},{"line_number":548,"context_line":"                    chunk_id +\u003d 1"},{"line_number":549,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":550,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":553,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_be097e34","line":550,"in_reply_to":"fa98f980_3c483e8a","updated":"2014-09-16 18:20:12.000000000","message":"gotcha","commit_id":"688508efe98bf9f3c5c1e3de283dfc227a08db37"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"dd963010fc7eb0b8235e0edd5213964775d2fc0c","unresolved":false,"context_lines":[{"line_number":972,"context_line":"        return self"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":975,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_dd498361","line":975,"updated":"2015-08-12 16:13:25.000000000","message":"Perhaps a dumb question, but why did these bits need to be added for this patch?","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"2e2c70818ecefa27cd731ac3d6e15a855eceddba","unresolved":false,"context_lines":[{"line_number":972,"context_line":"        return self"},{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    def __exit__(self, type, value, traceback):"},{"line_number":975,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a4dcd0f_d8c66799","line":975,"in_reply_to":"1a4dcd0f_dd498361","updated":"2015-08-13 16:54:47.000000000","message":"To support the \u0027with\u0027 statement introduced in this patch. \n\nThe \u0027__enter__\u0027 and \u0027__exit__\u0027 methods are used by the \u0027with\u0027 statement to set up and clean up required resources before and after the execution of a code block.\n\nMore info here http://effbot.org/zone/python-with-statement.htm","commit_id":"ef72d5476ea2b19b63fe149ab374c3cba6201449"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":120,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":121,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":122,"context_line":"    cfg.StrOpt(\u0027swift_buffer_on_upload\u0027, default\u003dFalse,"},{"line_number":123,"context_line":"               help\u003d_(\u0027A boolean value that indicates whether or not Glance \u0027"},{"line_number":124,"context_line":"                      \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":125,"context_line":"                      \u0027swift. This enables Glance to resume uploads on error. \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_ebe444ad","line":122,"updated":"2015-08-24 10:45:25.000000000","message":"If the option value is supposed to be Boolean, let\u0027s use BoolOpt then.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    cfg.IntOpt(\u0027swift_store_retry_get_count\u0027, default\u003d0,"},{"line_number":120,"context_line":"               help\u003d_(\u0027The number of times a Swift download will be retried \u0027"},{"line_number":121,"context_line":"                      \u0027before the request fails.\u0027)),"},{"line_number":122,"context_line":"    cfg.StrOpt(\u0027swift_buffer_on_upload\u0027, default\u003dFalse,"},{"line_number":123,"context_line":"               help\u003d_(\u0027A boolean value that indicates whether or not Glance \u0027"},{"line_number":124,"context_line":"                      \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":125,"context_line":"                      \u0027swift. This enables Glance to resume uploads on error. \u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_76e7a212","line":122,"in_reply_to":"fa1b9901_ebe444ad","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a17b0e8b746082c9065978e6c7ae335dd7e1d1f1","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                      \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":125,"context_line":"                      \u0027swift. This enables Glance to resume uploads on error. \u0027"},{"line_number":126,"context_line":"                      \u0027However, when enabling this, one should take great care\u0027"},{"line_number":127,"context_line":"                      \u0027as this increase disk usage on the API node. And, \u0027"},{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_0202dc6f","line":127,"updated":"2015-08-22 02:54:12.000000000","message":"should be \u0027increases\u0027","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                      \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":125,"context_line":"                      \u0027swift. This enables Glance to resume uploads on error. \u0027"},{"line_number":126,"context_line":"                      \u0027However, when enabling this, one should take great care\u0027"},{"line_number":127,"context_line":"                      \u0027as this increase disk usage on the API node. And, \u0027"},{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_96c9167c","line":127,"in_reply_to":"fa1b9901_0202dc6f","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"a17b0e8b746082c9065978e6c7ae335dd7e1d1f1","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                      \u0027as this increase disk usage on the API node. And, \u0027"},{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"},{"line_number":131,"context_line":"                      \u0027(image segment size * num. of simultaneous snapshots)\u0027))"},{"line_number":132,"context_line":"]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_02397c41","line":130,"updated":"2015-08-22 02:54:12.000000000","message":"I think you need a space between the colon and the closing quote.","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                      \u0027as this increase disk usage on the API node. And, \u0027"},{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"},{"line_number":131,"context_line":"                      \u0027(image segment size * num. of simultaneous snapshots)\u0027))"},{"line_number":132,"context_line":"]"},{"line_number":133,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_76cec284","line":130,"in_reply_to":"fa1b9901_02397c41","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fa54f98c265490c75ff6eb2fb3916c6ebbb03a80","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"},{"line_number":131,"context_line":"                      \u0027(image segment size * num. of simultaneous snapshots)\u0027))"},{"line_number":132,"context_line":"]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_2b89dcca","line":131,"updated":"2015-08-24 10:45:25.000000000","message":"uploads rather than snapshots. We do consume this for all uploads, right?","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"b53c9df750c4efeeb3787879e38350f27f45d10c","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                      \u0027depending how the file system is configured, it may \u0027"},{"line_number":129,"context_line":"                      \u0027even eat into the disk space available for glance \u0027"},{"line_number":130,"context_line":"                      \u0027image cache. Disk utilization will be equivalent to:\u0027"},{"line_number":131,"context_line":"                      \u0027(image segment size * num. of simultaneous snapshots)\u0027))"},{"line_number":132,"context_line":"]"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"fa1b9901_d6b6aef8","line":131,"in_reply_to":"fa1b9901_2b89dcca","updated":"2015-08-24 17:40:25.000000000","message":"Done","commit_id":"dd8cabc2d6ed62e8bdc5b5dbbd8c701a09a0f168"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"aad46a2bcfb940d3b62e1fbba353078a2dd81eac","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":441,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9a8ffd7b_0b29f59a","line":441,"updated":"2015-12-03 10:45:19.000000000","message":"I think it is better to use ChunkReader class directly and not to import it.\nYou also need to move ChunkReader class before base store but it makes dependency clear.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"3091a4c4bdebf6af8a2843961eb0e8b035339821","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":441,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_f5cdeab7","line":441,"in_reply_to":"7a740942_395f0c74","updated":"2015-12-04 16:24:50.000000000","message":"Agreed, it\u0027s in this module itself. Probably a leftover syntax from above.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"91e786f1b9e97b9025aa020008209c043f609c65","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":441,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_70fd8539","line":441,"in_reply_to":"7a740942_395f0c74","updated":"2015-12-04 17:50:42.000000000","message":"Yeah, makes sense.\nInitially, the reader class was a config option, which is why we were importing it like that. Since we\u0027ve moved away from that, it doesn\u0027t have to be imported any more.\n\nThanks for pointing this out! I\u0027ll push up a patchset soon.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"61cff956d97cadd2233c2aad25289e25116dcf47","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":441,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_395f0c74","line":441,"in_reply_to":"7a740942_a93e66b6","updated":"2015-12-04 06:31:38.000000000","message":"Nope. I am asking why do you need to import class from the module itself.\nPerhaps the following would be more appropriate:\nself.reader_class \u003d ChunkReader","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"5bdd204186b8217d80ee4ce2c92c08dd718ab7de","unresolved":false,"context_lines":[{"line_number":438,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":439,"context_line":"        else:"},{"line_number":440,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":441,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":444,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_a93e66b6","line":441,"in_reply_to":"9a8ffd7b_0b29f59a","updated":"2015-12-03 17:36:35.000000000","message":"Not sure I understand. Are you saying that I should move ChunkReader into Store class here [1] ?\n\n[1] https://github.com/openstack/glance_store/blob/master/glance_store/driver.py#L34","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"aad46a2bcfb940d3b62e1fbba353078a2dd81eac","unresolved":false,"context_lines":[{"line_number":565,"context_line":"                        content_length \u003d chunk_size"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"                    chunk_name \u003d \"%s-%05d\" % (location.obj, chunk_id)"},{"line_number":568,"context_line":"                    with self.reader_class(image_file, checksum,"},{"line_number":569,"context_line":"                                           chunk_size) as reader:"},{"line_number":570,"context_line":"                        try:"},{"line_number":571,"context_line":"                            chunk_etag \u003d connection.put_object("}],"source_content_type":"text/x-python","patch_set":13,"id":"9a8ffd7b_cbc1ade5","line":568,"updated":"2015-12-03 10:45:19.000000000","message":"Chunk reader doesn\u0027t have __exit__. So this going to fail existing environments IIUC.\nJust to be sure I did some minimal prototyping and my class without __exit__ failed.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"61cff956d97cadd2233c2aad25289e25116dcf47","unresolved":false,"context_lines":[{"line_number":565,"context_line":"                        content_length \u003d chunk_size"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"                    chunk_name \u003d \"%s-%05d\" % (location.obj, chunk_id)"},{"line_number":568,"context_line":"                    with self.reader_class(image_file, checksum,"},{"line_number":569,"context_line":"                                           chunk_size) as reader:"},{"line_number":570,"context_line":"                        try:"},{"line_number":571,"context_line":"                            chunk_etag \u003d connection.put_object("}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_591218b6","line":568,"in_reply_to":"7a740942_4e74a8fc","updated":"2015-12-04 06:31:38.000000000","message":"Yep, sorry, I missed that yesterday.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"5bdd204186b8217d80ee4ce2c92c08dd718ab7de","unresolved":false,"context_lines":[{"line_number":565,"context_line":"                        content_length \u003d chunk_size"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"                    chunk_name \u003d \"%s-%05d\" % (location.obj, chunk_id)"},{"line_number":568,"context_line":"                    with self.reader_class(image_file, checksum,"},{"line_number":569,"context_line":"                                           chunk_size) as reader:"},{"line_number":570,"context_line":"                        try:"},{"line_number":571,"context_line":"                            chunk_etag \u003d connection.put_object("}],"source_content_type":"text/x-python","patch_set":13,"id":"7a740942_4e74a8fc","line":568,"in_reply_to":"9a8ffd7b_cbc1ade5","updated":"2015-12-03 17:36:35.000000000","message":"__exit__ is being added in this patch. Scroll all the way down.","commit_id":"ad2e9e5f92fdd04fe138233cbde2e98defb22b48"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"b627f8b45e0fc51f2850ed668e36593454b6aa36","unresolved":false,"context_lines":[{"line_number":601,"context_line":""},{"line_number":602,"context_line":"                    chunk_id +\u003d 1"},{"line_number":603,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":604,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":607,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_25a559a1","line":604,"updated":"2015-12-07 01:36:26.000000000","message":"Why is re-setting the checksum required?","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e0193bb29f0287c92f027b5f059fb348c05cd865","unresolved":false,"context_lines":[{"line_number":601,"context_line":""},{"line_number":602,"context_line":"                    chunk_id +\u003d 1"},{"line_number":603,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":604,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":607,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_950f032e","line":604,"in_reply_to":"7a740942_25a559a1","updated":"2015-12-09 13:38:23.000000000","message":"+1","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"35c4b6c22706bf352c69955bcd05e00f2d9159e0","unresolved":false,"context_lines":[{"line_number":601,"context_line":""},{"line_number":602,"context_line":"                    chunk_id +\u003d 1"},{"line_number":603,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":604,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":607,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":14,"id":"fa69d971_06d93d83","line":604,"in_reply_to":"7a740942_950f032e","updated":"2016-01-08 21:12:49.000000000","message":"BufferedReader won\u0027t advance the checksum that was passed to it; it only ever copies the state. So at this point, checksum would be in the same state as before the upload.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"e9e90876c27863d7ac886a7391df2ce9955a4f71","unresolved":false,"context_lines":[{"line_number":601,"context_line":""},{"line_number":602,"context_line":"                    chunk_id +\u003d 1"},{"line_number":603,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":604,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":607,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":14,"id":"bae84128_3cbb55c6","line":604,"in_reply_to":"fa69d971_06d93d83","updated":"2016-02-19 18:05:33.000000000","message":"What Time said. Although, there is no reason why BufferedReader should not advance the checksum provided to it. Let me fix this in the next PS. It will make things a tad simpler.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"b627f8b45e0fc51f2850ed668e36593454b6aa36","unresolved":false,"context_lines":[{"line_number":621,"context_line":"                # users can verify the image file contents accordingly"},{"line_number":622,"context_line":"                connection.put_object(location.container, location.obj,"},{"line_number":623,"context_line":"                                      None, headers\u003dheaders)"},{"line_number":624,"context_line":"                obj_etag \u003d reader.checksum.hexdigest()"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"            # NOTE: We return the user and key here! Have to because"},{"line_number":627,"context_line":"            # location is used by the API server to return the actual"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a740942_45a0a590","line":624,"updated":"2015-12-07 01:36:26.000000000","message":"isn\u0027t checksum defined in L604? Can that be used?","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"e9e90876c27863d7ac886a7391df2ce9955a4f71","unresolved":false,"context_lines":[{"line_number":621,"context_line":"                # users can verify the image file contents accordingly"},{"line_number":622,"context_line":"                connection.put_object(location.container, location.obj,"},{"line_number":623,"context_line":"                                      None, headers\u003dheaders)"},{"line_number":624,"context_line":"                obj_etag \u003d reader.checksum.hexdigest()"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"            # NOTE: We return the user and key here! Have to because"},{"line_number":627,"context_line":"            # location is used by the API server to return the actual"}],"source_content_type":"text/x-python","patch_set":14,"id":"bae84128_9cfee169","line":624,"in_reply_to":"7a740942_45a0a590","updated":"2016-02-19 18:05:33.000000000","message":"This won\u0027t be required once I make the above change.","commit_id":"785c3811d6b5ad3b9c1f76e833f6c65bc59adb81"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"70e836c4887da1d8ecee742eddd4bfebe2ae4bc6","unresolved":false,"context_lines":[{"line_number":611,"context_line":""},{"line_number":612,"context_line":"                    chunk_id +\u003d 1"},{"line_number":613,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":614,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":617,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_3a2523ab","line":614,"updated":"2016-02-25 22:27:50.000000000","message":"What about verifier? Since our ChunkReader may be working with a deepcopy of the verifier, we\u0027re subject to the same partial-read issues that make us need to re-assign checksum.\n\nWorse, we need to ensure that the *caller* knows about the new verifier.","commit_id":"b6a7977fa3bf7f5bc0260bd74ac89705ea86c75d"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"f537feaec78a61f2d649177cbe87de0bec8dfaf0","unresolved":false,"context_lines":[{"line_number":611,"context_line":""},{"line_number":612,"context_line":"                    chunk_id +\u003d 1"},{"line_number":613,"context_line":"                    combined_chunks_size +\u003d bytes_read"},{"line_number":614,"context_line":"                    checksum \u003d reader.checksum"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"                # In the case we have been given an unknown image size,"},{"line_number":617,"context_line":"                # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":18,"id":"9aed3d3a_46274464","line":614,"in_reply_to":"9aed3d3a_3a2523ab","updated":"2016-02-26 15:40:47.000000000","message":"Spot-on, sir!\nFor the very reason you mention, I don\u0027t have a good answer yet. Let me give it more thought.","commit_id":"b6a7977fa3bf7f5bc0260bd74ac89705ea86c75d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2abc52aefcbfdafa4a584014dafe6335b91e7653","unresolved":false,"context_lines":[{"line_number":865,"context_line":"            context\u003dNone, verifier\u003dNone):"},{"line_number":866,"context_line":"        location \u003d self.create_location(image_id, context\u003dcontext)"},{"line_number":867,"context_line":"        # initialize a manager with re-auth if image need to be splitted"},{"line_number":868,"context_line":"        need_chunks \u003d (image_size \u003d\u003d 0) or ("},{"line_number":869,"context_line":"            image_size \u003e\u003d self.large_object_size)"},{"line_number":870,"context_line":"        with self.get_manager(location, context,"},{"line_number":871,"context_line":"                              allow_reauth\u003dneed_chunks) as manager:"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_859f4002","line":868,"range":{"start_line":868,"start_character":23,"end_line":868,"end_character":38},"updated":"2016-12-20 20:29:20.000000000","message":"I hadn\u0027t noticed that before, but... why do we need to chunk zero-byte images? Can we even *have* a zero-byte image, or should that be a ValueError or similar? Or am I missing some context, and 0 is being used as a sentinel for \"this is a `Transfer-Encoding: chunked` upload\"?","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"51d1e8117b2727a4ca115e61d42c9d1f56099f5f","unresolved":false,"context_lines":[{"line_number":865,"context_line":"            context\u003dNone, verifier\u003dNone):"},{"line_number":866,"context_line":"        location \u003d self.create_location(image_id, context\u003dcontext)"},{"line_number":867,"context_line":"        # initialize a manager with re-auth if image need to be splitted"},{"line_number":868,"context_line":"        need_chunks \u003d (image_size \u003d\u003d 0) or ("},{"line_number":869,"context_line":"            image_size \u003e\u003d self.large_object_size)"},{"line_number":870,"context_line":"        with self.get_manager(location, context,"},{"line_number":871,"context_line":"                              allow_reauth\u003dneed_chunks) as manager:"}],"source_content_type":"text/x-python","patch_set":19,"id":"da4df55a_11ce8c83","line":868,"range":{"start_line":868,"start_character":23,"end_line":868,"end_character":38},"in_reply_to":"1a6eadb0_859f4002","updated":"2016-12-21 21:08:06.000000000","message":"Tim, we want that to evaluate to True as that could mean something like an unknown image size. Line 904 here throws a debug message for that case.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"2abc52aefcbfdafa4a584014dafe6335b91e7653","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_c020464c","line":967,"updated":"2016-12-20 20:29:20.000000000","message":"Does the caller expect the verifier it passes in to see all uploaded content? Currently, if\n\n* the first chunk is uploaded successfully,\n* the second chunk fails then succeeds on the retry, and\n* all subsequent chunks upload successfully,\n\nthen our local verifier will be a deepcopy and will have seen all of the content, but the caller\u0027s verifier will only have seen the first chunk (and possibly some fraction of the second) and none of the subsequent chunks.\n\nYou might want to consider the modified BufferedReader I dropped in https://gist.github.com/tipabu/b737a1b4366d29458784 -- it avoids the deep copies and only updates its verifiers as new content is read.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"51d1e8117b2727a4ca115e61d42c9d1f56099f5f","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"da4df55a_d18164fd","line":967,"in_reply_to":"1a6eadb0_09734216","updated":"2016-12-21 21:08:06.000000000","message":"Submitting a new PS as per suggestions: Updating the checksum and verifier here, logging it as a message. Also, returning the updated verifier just like we are already returning the checksum.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"5849b9e8399bdb5f38d62823a4e47aba666a48ab","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_29ff1e02","line":967,"in_reply_to":"1a6eadb0_0ec0a829","updated":"2016-12-21 01:17:56.000000000","message":"Ahh I get the idea. Thanks for the explanation. I will work on this based on your suggestions from https://gist.github.com/tipabu/b737a1b4366d29458784 and also any other ways I can think of and submit a PS.\nThanks Tim.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"f0a074462083f352bd6c295b754dfe513d3e299b","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_69abd689","line":967,"in_reply_to":"1a6eadb0_29ff1e02","updated":"2016-12-21 01:32:52.000000000","message":"On second thought, an update of the verifier as here in line 967 with that of the BufferedReader\u0027s verifier seems like a problem solver.\nThis is the same reason as why we reset checksum in line 966 as well.\nCorrect me if I am wrong.\nFor reference I edited your example: http://paste.openstack.org/show/592972/","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7f7616808342daf164e7cc0bb6e5ccc3d41830e9","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_0ec0a829","line":967,"in_reply_to":"1a6eadb0_334dcd72","updated":"2016-12-21 01:11:25.000000000","message":"The trouble is that on a failure, it\u0027s not the same object reference anymore.\n\nI wrote up http://paste.openstack.org/show/592968/ to try to demonstrate the problem. (I used md5.copy() instead of cryptography\u0027s signature algos \u0026 copy.deepcopy(), but the principle is the same.)\n\nThe caller\u0027s verifier gets partially updated during the failed attempt on line 11. When we \"reset\" our verifier on line 13, we have a separate object whose state was copied from the original (pre-partial-update) verifier. As a result we get the correct value locally (comparing the output from lines 16 and 25), but leave the caller with the partial update (line 24).","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b73a1956cad7f18a02a13dc8a3f10b51a17559b8","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_a9d16efd","line":967,"in_reply_to":"1a6eadb0_69abd689","updated":"2016-12-21 01:39:22.000000000","message":"Sure? I guess we can add our (possibly modified) verifier to the return args down at line 999 and update whoever calls BaseStore.add() (I\u0027m guessing back in the glance project?).\n\nJust figured it might make for a cleaner API to not require that our caller update their reference.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"54652d3cbccd896b87dae6596f3f4de47fafdde2","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_09734216","line":967,"in_reply_to":"1a6eadb0_a9d16efd","updated":"2016-12-21 01:43:55.000000000","message":"Sure. That sounds good to me. :)","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"fa286fac57d76892e1abcbf943657562f2a1b65b","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"1a6eadb0_334dcd72","line":967,"in_reply_to":"1a6eadb0_c020464c","updated":"2016-12-21 00:05:45.000000000","message":"Hi Tim, I am not sure I understand. Since we are using copies of both the checksum and the verifier passed by the caller purely for resetting purposes (by seeking due to any failure), and are not updating our copies of both checksum and verfier , but rather working with the object references passed by our caller, would not the caller see whatever the called function sees as well?\nI may be missing something here. Can you please help me understand?","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9f588a1f7e021e8cbe34ace68aa1e28f5eb46850","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                        chunk_id +\u003d 1"},{"line_number":965,"context_line":"                        combined_chunks_size +\u003d bytes_read"},{"line_number":966,"context_line":"                        checksum \u003d reader.checksum"},{"line_number":967,"context_line":"                        verifier \u003d reader.verifier"},{"line_number":968,"context_line":""},{"line_number":969,"context_line":"                    # In the case we have been given an unknown image size,"},{"line_number":970,"context_line":"                    # set the size to the total size of the combined chunks."}],"source_content_type":"text/x-python","patch_set":19,"id":"ba5201f7_0e06b985","line":967,"in_reply_to":"da4df55a_d18164fd","updated":"2017-01-05 18:42:52.000000000","message":"Dharini,\nWhat Tim said above \"Just figured it might make for a cleaner API to not require that our caller update their reference.\" makes sense. \nIt is definitely cleaner and intuitive to update the passed verifier than expecting the caller to update the verifier themselves. Would you be willing to explore the solution Tim proposed? It sounds like a cleaner approach.","commit_id":"4504115bc5f83b2c6507e21ac0f7f4ab21d3c6ec"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":453,"context_line":"                help\u003d_(\u0027A boolean value that indicates whether or not Glance \u0027"},{"line_number":454,"context_line":"                       \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":455,"context_line":"                       \u0027swift. This enables Glance to resume uploads on error.\u0027"},{"line_number":456,"context_line":"                       \u0027 However, when enabling this, one should take great \u0027"},{"line_number":457,"context_line":"                       \u0027care as this increases disk usage on the API node. \u0027"},{"line_number":458,"context_line":"                       \u0027And, depending how the file system is configured, it \u0027"},{"line_number":459,"context_line":"                       \u0027may even eat into the disk space available for glance \u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_7431ab59","line":456,"updated":"2017-01-06 18:49:23.000000000","message":"Nit: Inconsistent spacing. Put space at end of previous line.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":455,"context_line":"                       \u0027swift. This enables Glance to resume uploads on error.\u0027"},{"line_number":456,"context_line":"                       \u0027 However, when enabling this, one should take great \u0027"},{"line_number":457,"context_line":"                       \u0027care as this increases disk usage on the API node. \u0027"},{"line_number":458,"context_line":"                       \u0027And, depending how the file system is configured, it \u0027"},{"line_number":459,"context_line":"                       \u0027may even eat into the disk space available for glance \u0027"},{"line_number":460,"context_line":"                       \u0027image cache. Disk utilization will be equivalent to: \u0027"},{"line_number":461,"context_line":"                       \u0027(image segment size * num. of simultaneous uploads)\u0027))"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_344483b5","line":458,"updated":"2017-01-06 18:49:23.000000000","message":"Nit: s/And, d/D/","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                       \u0027 However, when enabling this, one should take great \u0027"},{"line_number":457,"context_line":"                       \u0027care as this increases disk usage on the API node. \u0027"},{"line_number":458,"context_line":"                       \u0027And, depending how the file system is configured, it \u0027"},{"line_number":459,"context_line":"                       \u0027may even eat into the disk space available for glance \u0027"},{"line_number":460,"context_line":"                       \u0027image cache. Disk utilization will be equivalent to: \u0027"},{"line_number":461,"context_line":"                       \u0027(image segment size * num. of simultaneous uploads)\u0027))"},{"line_number":462,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_940b6f7c","line":459,"updated":"2017-01-06 18:49:23.000000000","message":"Nit: s/even//","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":967,"context_line":"                        # that of Reader\u0027s verifier; This is required as in"},{"line_number":968,"context_line":"                        # event of resets due to seek operations initiated by"},{"line_number":969,"context_line":"                        # python-swiftclient if using the BufferedReader,"},{"line_number":970,"context_line":"                        # the object refrence is lost."},{"line_number":971,"context_line":"                        if checksum !\u003d reader.checksum:"},{"line_number":972,"context_line":"                            checksum \u003d reader.checksum"},{"line_number":973,"context_line":"                            verifier \u003d reader.verifier"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_b45cf37d","line":970,"updated":"2017-01-06 18:49:23.000000000","message":"This NOTE is hard to follow. Consider rephrasing.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"9c29d5a896028a8b90492d39b8f3a33a076a31a1","unresolved":false,"context_lines":[{"line_number":967,"context_line":"                        # that of Reader\u0027s verifier; This is required as in"},{"line_number":968,"context_line":"                        # event of resets due to seek operations initiated by"},{"line_number":969,"context_line":"                        # python-swiftclient if using the BufferedReader,"},{"line_number":970,"context_line":"                        # the object refrence is lost."},{"line_number":971,"context_line":"                        if checksum !\u003d reader.checksum:"},{"line_number":972,"context_line":"                            checksum \u003d reader.checksum"},{"line_number":973,"context_line":"                            verifier \u003d reader.verifier"}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_b7806e8c","line":970,"in_reply_to":"ba5201f7_b45cf37d","updated":"2017-01-07 00:12:30.000000000","message":"Done","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"402ba97dcecfc0030dad37363174b8e1211b6f12","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"                    include_creds \u003d False"},{"line_number":1005,"context_line":"                else:"},{"line_number":1006,"context_line":"                    include_creds \u003d True"},{"line_number":1007,"context_line":"                return (location.get_uri(credentials_included\u003dinclude_creds),"},{"line_number":1008,"context_line":"                        image_size, obj_etag, {})"},{"line_number":1009,"context_line":"            except swiftclient.ClientException as e:"},{"line_number":1010,"context_line":"                if e.http_status \u003d\u003d http_client.CONFLICT:"}],"source_content_type":"text/x-python","patch_set":21,"id":"da4df55a_859bb771","line":1007,"updated":"2016-12-23 17:46:55.000000000","message":"Returning the verifier explicitly here causes tempest test failures as in [1] (PS 20) as the test cases would probably not be unpacking it. Unless we want to edit the tempest tests and thereby allow image creation to succeed. Hence leaving it as it is, but updating it for the caller as in line 973.\n[1] http://logs.openstack.org/66/120866/20/check/gate-tempest-dsvm-neutron-src-glance_store-ubuntu-xenial/61895a3/logs/screen-g-api.txt.gz","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74afaf3e9e9831c6853c280edae157b6be8c57a5","unresolved":false,"context_lines":[{"line_number":450,"context_line":""},{"line_number":451,"context_line":"\"\"\")),"},{"line_number":452,"context_line":"    cfg.BoolOpt(\u0027swift_buffer_on_upload\u0027, default\u003dFalse,"},{"line_number":453,"context_line":"                help\u003d_(\u0027A boolean value that indicates whether or not Glance \u0027"},{"line_number":454,"context_line":"                       \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":455,"context_line":"                       \u0027swift. This enables Glance to resume uploads on error.\u0027"},{"line_number":456,"context_line":"                       \u0027 However, when enabling this, one should take great \u0027"},{"line_number":457,"context_line":"                       \u0027care as this increases disk usage on the API node. \u0027"},{"line_number":458,"context_line":"                       \u0027And, Depending how the file system is configured, it \u0027"},{"line_number":459,"context_line":"                       \u0027may eat into the disk space available for glance \u0027"},{"line_number":460,"context_line":"                       \u0027image cache. Disk utilization will be equivalent to: \u0027"},{"line_number":461,"context_line":"                       \u0027(image segment size * num. of simultaneous uploads)\u0027))"},{"line_number":462,"context_line":"]"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_868f7022","line":461,"range":{"start_line":453,"start_character":23,"end_line":461,"end_character":76},"updated":"2017-01-13 18:43:49.000000000","message":"Same","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"4000433b7d0d6c2d037e266b461cda76c6a421aa","unresolved":false,"context_lines":[{"line_number":450,"context_line":""},{"line_number":451,"context_line":"\"\"\")),"},{"line_number":452,"context_line":"    cfg.BoolOpt(\u0027swift_buffer_on_upload\u0027, default\u003dFalse,"},{"line_number":453,"context_line":"                help\u003d_(\u0027A boolean value that indicates whether or not Glance \u0027"},{"line_number":454,"context_line":"                       \u0027should buffer image data to disk while uploading to \u0027"},{"line_number":455,"context_line":"                       \u0027swift. This enables Glance to resume uploads on error.\u0027"},{"line_number":456,"context_line":"                       \u0027 However, when enabling this, one should take great \u0027"},{"line_number":457,"context_line":"                       \u0027care as this increases disk usage on the API node. \u0027"},{"line_number":458,"context_line":"                       \u0027And, Depending how the file system is configured, it \u0027"},{"line_number":459,"context_line":"                       \u0027may eat into the disk space available for glance \u0027"},{"line_number":460,"context_line":"                       \u0027image cache. Disk utilization will be equivalent to: \u0027"},{"line_number":461,"context_line":"                       \u0027(image segment size * num. of simultaneous uploads)\u0027))"},{"line_number":462,"context_line":"]"},{"line_number":463,"context_line":""},{"line_number":464,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_14ae4a2e","line":461,"range":{"start_line":453,"start_character":23,"end_line":461,"end_character":76},"in_reply_to":"7a3c09a3_868f7022","updated":"2017-01-13 19:45:09.000000000","message":"Done","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5afa7d2da7ab4b888377d53a0a6a7469c38ff201","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"NOTES:"},{"line_number":462,"context_line":"When enabling this option, one should take great care as this"},{"line_number":463,"context_line":"increases disk usage on the API node. And, Depending how"},{"line_number":464,"context_line":"the file system is configured, it may eat into the disk space"},{"line_number":465,"context_line":"available for glance image cache. Disk utilization will be"},{"line_number":466,"context_line":"equivalent to: (image segment size * num. of simultaneous uploads)"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"Possible values:"},{"line_number":469,"context_line":"    * True"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_db92f59e","line":466,"range":{"start_line":463,"start_character":38,"end_line":466,"end_character":66},"updated":"2017-01-16 14:58:35.000000000","message":"I suggest replacing this with:\n\nBe aware that depending upon how the file system is configured, the disk space used for buffering may decrease the actual disk space available for the glance image cache.  Disk utilization will be on the order of the ``swift_store_large_object_chunk_size`` times the the maximum number of simultaneous image uploads (which is, in turn, on the order of ``workers`` (in the glance-api.conf) times 1000).","commit_id":"35269f01cb9f1f216087301dd0a8e2c4f92cc8af"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"61918ab57ec15a793f1fad1bb8512c9395af5507","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"NOTES:"},{"line_number":462,"context_line":"When enabling this option, one should take great care as this"},{"line_number":463,"context_line":"increases disk usage on the API node. And, Depending how"},{"line_number":464,"context_line":"the file system is configured, it may eat into the disk space"},{"line_number":465,"context_line":"available for glance image cache. Disk utilization will be"},{"line_number":466,"context_line":"equivalent to: (image segment size * num. of simultaneous uploads)"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"Possible values:"},{"line_number":469,"context_line":"    * True"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_b8fe0436","line":466,"range":{"start_line":463,"start_character":38,"end_line":466,"end_character":66},"in_reply_to":"7a3c09a3_db92f59e","updated":"2017-01-16 17:38:23.000000000","message":"Done","commit_id":"35269f01cb9f1f216087301dd0a8e2c4f92cc8af"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5afa7d2da7ab4b888377d53a0a6a7469c38ff201","unresolved":false,"context_lines":[{"line_number":469,"context_line":"    * True"},{"line_number":470,"context_line":"    * False"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"Related options:"},{"line_number":473,"context_line":"    * swift_upload_buffer_dir"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"\"\"\"))"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_bbe8c9e3","line":472,"updated":"2017-01-16 14:58:35.000000000","message":"I don\u0027t remember if mentioning an option in a note makes it \"related\", or whether we are working with a more restricted notion of \"related\" here.","commit_id":"35269f01cb9f1f216087301dd0a8e2c4f92cc8af"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"61918ab57ec15a793f1fad1bb8512c9395af5507","unresolved":false,"context_lines":[{"line_number":469,"context_line":"    * True"},{"line_number":470,"context_line":"    * False"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"Related options:"},{"line_number":473,"context_line":"    * swift_upload_buffer_dir"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"\"\"\"))"}],"source_content_type":"text/x-python","patch_set":30,"id":"7a3c09a3_78ec9c8f","line":472,"in_reply_to":"7a3c09a3_bbe8c9e3","updated":"2017-01-16 17:38:23.000000000","message":"I think we should just have the options directly related. For example, setting this (swift_buffer_on_upload) option to False will nullify the value given to \"swift_upload_buffer_dir\".\nBut thats not the case with \"swift_store_large_object_chunk_size\" which we mention in Notes cos we warn the user to be aware. \nLet me know what you think.","commit_id":"35269f01cb9f1f216087301dd0a8e2c4f92cc8af"},{"author":{"_account_id":20382,"name":"YuYang","email":"yuyangwang1985@gmail.com","username":"YuYangWang"},"change_message_id":"ebca4cc1d31a28754c306d55e574643dd5f6d4a3","unresolved":false,"context_lines":[{"line_number":791,"context_line":"            raise exceptions.BadStoreConfiguration(store_name\u003d\"swift\","},{"line_number":792,"context_line":"                                                   reason\u003dmsg)"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buff_reader \u003d \u0027glance_store._drivers.swift.buffered.BufferedReader\u0027"},{"line_number":796,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":797,"context_line":"        else:"},{"line_number":798,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":799,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_b470bddd","line":799,"range":{"start_line":794,"start_character":8,"end_line":799,"end_character":70},"updated":"2017-01-17 02:05:00.000000000","message":"what is the difference between the two Reader?","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"c369e66f4e272bdaaab16a8c648c37ff61087dc1","unresolved":false,"context_lines":[{"line_number":791,"context_line":"            raise exceptions.BadStoreConfiguration(store_name\u003d\"swift\","},{"line_number":792,"context_line":"                                                   reason\u003dmsg)"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buff_reader \u003d \u0027glance_store._drivers.swift.buffered.BufferedReader\u0027"},{"line_number":796,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":797,"context_line":"        else:"},{"line_number":798,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":799,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_0e295c37","line":799,"range":{"start_line":794,"start_character":8,"end_line":799,"end_character":70},"in_reply_to":"7a3c09a3_b470bddd","updated":"2017-01-17 15:46:28.000000000","message":"One buffers before uploading a segment to Swift, the other doesn\u0027t.","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":744,"context_line":"            raise exceptions.BadStoreConfiguration(store_name\u003d\"swift\","},{"line_number":745,"context_line":"                                                   reason\u003dmsg)"},{"line_number":746,"context_line":"    try:"},{"line_number":747,"context_line":"        conf.register_opts(_SWIFT_OPTS + sutils.swift_opts + buffered."},{"line_number":748,"context_line":"                           BUFFERING_OPTS, group\u003d\u0027glance_store\u0027)"},{"line_number":749,"context_line":"    except cfg.DuplicateOptError:"},{"line_number":750,"context_line":"        pass"},{"line_number":751,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_02348847","line":748,"range":{"start_line":747,"start_character":61,"end_line":748,"end_character":41},"updated":"2017-01-18 16:29:52.000000000","message":"Let\u0027s move everything to the next line if we can.","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":744,"context_line":"            raise exceptions.BadStoreConfiguration(store_name\u003d\"swift\","},{"line_number":745,"context_line":"                                                   reason\u003dmsg)"},{"line_number":746,"context_line":"    try:"},{"line_number":747,"context_line":"        conf.register_opts(_SWIFT_OPTS + sutils.swift_opts + buffered."},{"line_number":748,"context_line":"                           BUFFERING_OPTS, group\u003d\u0027glance_store\u0027)"},{"line_number":749,"context_line":"    except cfg.DuplicateOptError:"},{"line_number":750,"context_line":"        pass"},{"line_number":751,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_74e1809a","line":748,"range":{"start_line":747,"start_character":61,"end_line":748,"end_character":41},"in_reply_to":"7a3c09a3_02348847","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":796,"context_line":"            if glance_conf.swift_upload_buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Please provide a non empty directory to buffer image \u0027"},{"line_number":798,"context_line":"                        \u0027segments before upload to Swift.\u0027)"},{"line_number":799,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_625c6c4b","line":798,"range":{"start_line":797,"start_character":25,"end_line":798,"end_character":57},"updated":"2017-01-18 16:29:52.000000000","message":"While this is okay, I think a more useful error message would be tell the operators exactly what config option to set. So, how about something like:\n \"Configuration option ``swift_upload_buffer_dir`` is not set. Please set it to a valid path to buffer on Swift uploads.\"","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":796,"context_line":"            if glance_conf.swift_upload_buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Please provide a non empty directory to buffer image \u0027"},{"line_number":798,"context_line":"                        \u0027segments before upload to Swift.\u0027)"},{"line_number":799,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_94ec2c94","line":798,"range":{"start_line":797,"start_character":25,"end_line":798,"end_character":57},"in_reply_to":"7a3c09a3_625c6c4b","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":796,"context_line":"            if glance_conf.swift_upload_buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Please provide a non empty directory to buffer image \u0027"},{"line_number":798,"context_line":"                        \u0027segments before upload to Swift.\u0027)"},{"line_number":799,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"},{"line_number":802,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_0f0e708b","line":799,"range":{"start_line":799,"start_character":33,"end_line":799,"end_character":57},"updated":"2017-01-18 16:29:52.000000000","message":"How about raising a BadStoreConfiguration instead?","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":796,"context_line":"            if glance_conf.swift_upload_buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Please provide a non empty directory to buffer image \u0027"},{"line_number":798,"context_line":"                        \u0027segments before upload to Swift.\u0027)"},{"line_number":799,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"},{"line_number":802,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_d4e6b4af","line":799,"range":{"start_line":799,"start_character":33,"end_line":799,"end_character":57},"in_reply_to":"7a3c09a3_0f0e708b","updated":"2017-01-18 18:38:03.000000000","message":"Felt a dedicated exception might be better. But I am okay with \u0027BadStoreConfiguration\u0027 too.","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"},{"line_number":802,"context_line":"            try:"},{"line_number":803,"context_line":"                import tempfile"},{"line_number":804,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dglance_conf."},{"line_number":805,"context_line":"                                                  swift_upload_buffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_bd65991e","line":805,"range":{"start_line":804,"start_character":54,"end_line":805,"end_character":73},"updated":"2017-01-18 16:29:52.000000000","message":"Let\u0027s extract this into a variable if need be.","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":801,"context_line":"            # Ensure that the provided directory path is valid"},{"line_number":802,"context_line":"            try:"},{"line_number":803,"context_line":"                import tempfile"},{"line_number":804,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dglance_conf."},{"line_number":805,"context_line":"                                                  swift_upload_buffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_f4ebb076","line":805,"range":{"start_line":804,"start_character":54,"end_line":805,"end_character":73},"in_reply_to":"7a3c09a3_bd65991e","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dglance_conf."},{"line_number":805,"context_line":"                                                  swift_upload_buffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":809,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":810,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_fd8001f9","line":807,"range":{"start_line":807,"start_character":26,"end_line":807,"end_character":58},"updated":"2017-01-18 16:29:52.000000000","message":"Similarly, this error message could include a bit more detail to be more useful to operators. My suggestion is:\n \"Unable to use buffer directory set with ``swift_upload_buffer_dir``. Error: %s\"","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dglance_conf."},{"line_number":805,"context_line":"                                                  swift_upload_buffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":809,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":810,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_14011c3a","line":807,"range":{"start_line":807,"start_character":26,"end_line":807,"end_character":58},"in_reply_to":"7a3c09a3_fd8001f9","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":809,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":810,"context_line":"            else:"},{"line_number":811,"context_line":"                _tmpfile.close()"},{"line_number":812,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_2f296ce6","line":809,"range":{"start_line":809,"start_character":33,"end_line":809,"end_character":57},"updated":"2017-01-18 16:29:52.000000000","message":"Same?","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Cannot buffer image segments: %s\u0027) %"},{"line_number":808,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":809,"context_line":"                raise exceptions.SwiftBufferedReaderError(msg)"},{"line_number":810,"context_line":"            else:"},{"line_number":811,"context_line":"                _tmpfile.close()"},{"line_number":812,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_34fe1839","line":809,"range":{"start_line":809,"start_character":33,"end_line":809,"end_character":57},"in_reply_to":"7a3c09a3_2f296ce6","updated":"2017-01-18 18:38:03.000000000","message":"Felt a dedicated exception might be better. But I am okay with \u0027BadStoreConfiguration\u0027 too.","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9e318572c54b037d44b360548be8c3ffcfdc6b45","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    import swiftclient"},{"line_number":36,"context_line":"except ImportError:"},{"line_number":37,"context_line":"    swiftclient \u003d None"},{"line_number":38,"context_line":"import tempfile"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"import glance_store"},{"line_number":41,"context_line":"from glance_store._drivers.swift import buffered"}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_f43e50d9","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":15},"updated":"2017-01-18 18:48:17.000000000","message":"This should go with the first set of import as it is an import from standard library.","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"434d280d84644a4e1fc14f82343138e782c32327","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    import swiftclient"},{"line_number":36,"context_line":"except ImportError:"},{"line_number":37,"context_line":"    swiftclient \u003d None"},{"line_number":38,"context_line":"import tempfile"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"import glance_store"},{"line_number":41,"context_line":"from glance_store._drivers.swift import buffered"}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_62545eca","line":38,"range":{"start_line":38,"start_character":0,"end_line":38,"end_character":15},"in_reply_to":"7a3c09a3_f43e50d9","updated":"2017-01-18 18:55:13.000000000","message":"Done","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9e318572c54b037d44b360548be8c3ffcfdc6b45","unresolved":false,"context_lines":[{"line_number":796,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":797,"context_line":"            if buffer_dir is None:"},{"line_number":798,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":799,"context_line":"                        \u0027not set. Please set it to a valid path to buffer on \u0027"},{"line_number":800,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":801,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":802,"context_line":"                                                       reason\u003dmsg)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_97fd0e0b","line":800,"range":{"start_line":799,"start_character":74,"end_line":800,"end_character":31},"updated":"2017-01-18 18:48:17.000000000","message":"on or during","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"434d280d84644a4e1fc14f82343138e782c32327","unresolved":false,"context_lines":[{"line_number":796,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":797,"context_line":"            if buffer_dir is None:"},{"line_number":798,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":799,"context_line":"                        \u0027not set. Please set it to a valid path to buffer on \u0027"},{"line_number":800,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":801,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":802,"context_line":"                                                       reason\u003dmsg)"},{"line_number":803,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_a25c86f1","line":800,"range":{"start_line":799,"start_character":74,"end_line":800,"end_character":31},"in_reply_to":"7a3c09a3_97fd0e0b","updated":"2017-01-18 18:55:13.000000000","message":"Done","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                _tmpfile.close()"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"            buff_reader \u003d \u0027glance_store._drivers.swift.buffered.BufferedReader\u0027"},{"line_number":817,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":820,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_851ce614","line":817,"updated":"2017-01-19 00:34:16.000000000","message":"Why the dynamic import? Why not just\n\n self.reader_class \u003d buffered.BufferedReader\n\n?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":814,"context_line":"                _tmpfile.close()"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"            buff_reader \u003d \u0027glance_store._drivers.swift.buffered.BufferedReader\u0027"},{"line_number":817,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":820,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_bf9396a2","line":817,"in_reply_to":"7a3c09a3_851ce614","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":817,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":820,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":823,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_05be36d4","line":820,"updated":"2017-01-19 00:34:16.000000000","message":"Similarly here:\n\n self.reader_class \u003d ChunkReader","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":817,"context_line":"            self.reader_class \u003d importutils.import_class(buff_reader)"},{"line_number":818,"context_line":"        else:"},{"line_number":819,"context_line":"            chunk_reader \u003d \u0027glance_store._drivers.swift.store.ChunkReader\u0027"},{"line_number":820,"context_line":"            self.reader_class \u003d importutils.import_class(chunk_reader)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":"        super(BaseStore, self).configure(re_raise_bsc\u003dre_raise_bsc)"},{"line_number":823,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_ff8d1e7c","line":820,"in_reply_to":"7a3c09a3_05be36d4","updated":"2017-01-19 21:01:20.000000000","message":"Done","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":983,"context_line":"                                                    \"upload to backend, \""},{"line_number":984,"context_line":"                                                    \"deleting stale chunks\"))"},{"line_number":985,"context_line":"                                    self._delete_stale_chunks("},{"line_number":986,"context_line":"                                        manager.get_connection,"},{"line_number":987,"context_line":"                                        location.container,"},{"line_number":988,"context_line":"                                        written_chunks)"},{"line_number":989,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_c5a98e7d","line":986,"range":{"start_line":986,"start_character":48,"end_line":986,"end_character":62},"updated":"2017-01-19 00:34:16.000000000","message":"This used to be called. Is it intentional that we\u0027re now passing the function?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":983,"context_line":"                                                    \"upload to backend, \""},{"line_number":984,"context_line":"                                                    \"deleting stale chunks\"))"},{"line_number":985,"context_line":"                                    self._delete_stale_chunks("},{"line_number":986,"context_line":"                                        manager.get_connection,"},{"line_number":987,"context_line":"                                        location.container,"},{"line_number":988,"context_line":"                                        written_chunks)"},{"line_number":989,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_bfdab676","line":986,"range":{"start_line":986,"start_character":48,"end_line":986,"end_character":62},"in_reply_to":"7a3c09a3_c5a98e7d","updated":"2017-01-19 21:01:20.000000000","message":"Thanks for catching this Tim. It was a mistake that cropped up during rebase.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"601af86ee4126e633ed16914e24b4dd55c60bf4f","unresolved":false,"context_lines":[{"line_number":464,"context_line":"upon how the file system is configured, the disk space used"},{"line_number":465,"context_line":"for buffering may decrease the actual disk space available for"},{"line_number":466,"context_line":"the glance image cache.  Disk utilization will be on the order"},{"line_number":467,"context_line":"of the ``swift_store_large_object_chunk_size`` times the the"},{"line_number":468,"context_line":"maximum number of simultaneous image uploads (which is, in turn,"},{"line_number":469,"context_line":"on the order of ``workers`` (in the glance-api.conf) times 1000)."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"Possible values:"},{"line_number":472,"context_line":"    * True"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_d6aeba80","line":469,"range":{"start_line":467,"start_character":47,"end_line":469,"end_character":64},"updated":"2017-01-24 20:48:33.000000000","message":"I would far prefer an equation representation here because it might communicate the concept more clearly, but you have \u0027the the\u0027 in here which should be cleaned up at the least.\n\nA potential revision might say something like the following.\n\nDisk utilization for the buffer will cap according the following equation:\n  ``swift_store_large_object_chunk_size`` * ``workers`` * 1000\n\n\nNoting:\n``swift_store_large_object_chunk_size`` is perhaps measured in megabytes, but is not documented in the config to have any unit.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"946c67f703808937526684f9bcd204f453aa9a32","unresolved":false,"context_lines":[{"line_number":464,"context_line":"upon how the file system is configured, the disk space used"},{"line_number":465,"context_line":"for buffering may decrease the actual disk space available for"},{"line_number":466,"context_line":"the glance image cache.  Disk utilization will be on the order"},{"line_number":467,"context_line":"of the ``swift_store_large_object_chunk_size`` times the the"},{"line_number":468,"context_line":"maximum number of simultaneous image uploads (which is, in turn,"},{"line_number":469,"context_line":"on the order of ``workers`` (in the glance-api.conf) times 1000)."},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"Possible values:"},{"line_number":472,"context_line":"    * True"}],"source_content_type":"text/x-python","patch_set":39,"id":"3a461143_f33bb09a","line":469,"range":{"start_line":467,"start_character":47,"end_line":469,"end_character":64},"in_reply_to":"5a3905b3_d6aeba80","updated":"2017-01-25 21:21:46.000000000","message":"The help text of ``swift_store_large_object_chunk_size`` does mention that it is in MB Steve. So i guess it should be okay.\n\nNice suggestion about having the equation. Will get rid of the words.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"601af86ee4126e633ed16914e24b4dd55c60bf4f","unresolved":false,"context_lines":[{"line_number":473,"context_line":"    * False"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"Related options:"},{"line_number":476,"context_line":"    * swift_upload_buffer_dir"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"\"\"\"))"},{"line_number":479,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_21125659","line":476,"updated":"2017-01-24 20:48:33.000000000","message":"also swift_store_large_object_chunk_size and workers ?","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"946c67f703808937526684f9bcd204f453aa9a32","unresolved":false,"context_lines":[{"line_number":473,"context_line":"    * False"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"Related options:"},{"line_number":476,"context_line":"    * swift_upload_buffer_dir"},{"line_number":477,"context_line":""},{"line_number":478,"context_line":"\"\"\"))"},{"line_number":479,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":39,"id":"3a461143_d381544f","line":476,"in_reply_to":"5a3905b3_21125659","updated":"2017-01-25 21:21:46.000000000","message":"Steve, the values assigned to those options will not directly affect the boolean value assigned to this opt. Hence, did not include it here.\nGenerally we include those options that would directly affect the current opt or vice versa in question. Like setting \"swift_buffer_on_upload\" will need one to go and set \"swift_upload_buffer_dir\". Was not sure if thats the case with \"workers\" and \"swift_store_large_object_chunk_size\".\nDo you suggest we add it here anyway?","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"601af86ee4126e633ed16914e24b4dd55c60bf4f","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_e1b20e06","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"updated":"2017-01-24 20:48:33.000000000","message":"I believe this logic should live in a validation function in the buffered module. The configuration item is defined there so it seems reasonable to co-locate this logic in that module as well.\n\nthat we import tempfile into the store module for the purposes of validating this foreign config option is a code smell.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"cb2e460a68edbc71b07952cd95fdf8bdbde704a8","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_cf2ff43c","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"in_reply_to":"5a3905b3_0c390a42","updated":"2017-01-24 21:14:19.000000000","message":"The validation method probably ought to be a method in the buffered.py file (though, not in the BufferedReader class). That allows the same fail-fast behavior and puts the logic next to the class that depends on it. I believe the tempfile import here is a code smell indicating that this validation logic is a concern which has leaked into the wrong file.\n\nMoving the above validation logic into a function in this file would be a small improvement, but I maintain that it would fit better in buffered.py -- it certainly isn\u0027t a blocker for the feature either way, but in buffered.py would be a better factoring.\n\nI considered recommending swift_buffer_on_upload config be part of the buffered.BUFFERING_OPTS options list (in buffered.py), but felt that one was too much of a nit but I think I would /slightly/ prefer that too.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"946c67f703808937526684f9bcd204f453aa9a32","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"3a461143_25cc0f35","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"in_reply_to":"5a3905b3_0f71fce0","updated":"2017-01-25 21:21:46.000000000","message":"Moved this validation logic to buffered.py. Thanks Steve.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"946c67f703808937526684f9bcd204f453aa9a32","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"3a461143_085e4ae9","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"in_reply_to":"5a3905b3_cf2ff43c","updated":"2017-01-25 21:21:46.000000000","message":"I feel that since the opt \"swift_buffer_on_upload\" is something that decides on the entry to buffering, and by itself is not an opt for buffering to happen, we can have it with the rest of the swift opts. Any strong reason we should move it buffered.py\u0027s BUFFERING_OPTS?","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"d4e01ebf1cc11f2862bbc2224e6dfe1af0a6698c","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_0f71fce0","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"in_reply_to":"5a3905b3_cf2ff43c","updated":"2017-01-24 21:23:10.000000000","message":"Inclined to agree. Will work out the possibilities of the suggestions and improvements in the upcoming PS. Thanks Steve.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"ed18cd3e4a614c0c9735528e2186d107d3a964ba","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":795,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":796,"context_line":"            if buffer_dir is None:"},{"line_number":797,"context_line":"                msg \u003d _(\u0027Configuration option \"swift_upload_buffer_dir\" is \u0027"},{"line_number":798,"context_line":"                        \u0027not set. Please set it to a valid path to buffer \u0027"},{"line_number":799,"context_line":"                        \u0027during Swift uploads.\u0027)"},{"line_number":800,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":801,"context_line":"                                                       reason\u003dmsg)"},{"line_number":802,"context_line":""},{"line_number":803,"context_line":"            # Ensure that the provided directory path for buffering is valid"},{"line_number":804,"context_line":"            try:"},{"line_number":805,"context_line":"                _tmpfile \u003d tempfile.TemporaryFile(dir\u003dbuffer_dir)"},{"line_number":806,"context_line":"            except OSError as err:"},{"line_number":807,"context_line":"                msg \u003d (_(\u0027Unable to use buffer directory set with \u0027"},{"line_number":808,"context_line":"                         \u0027\"swift_upload_buffer_dir\". Error: %s\u0027) %"},{"line_number":809,"context_line":"                       encodeutils.exception_to_unicode(err))"},{"line_number":810,"context_line":"                raise exceptions.BadStoreConfiguration(store_name\u003d\u0027swift\u0027,"},{"line_number":811,"context_line":"                                                       reason\u003dmsg)"},{"line_number":812,"context_line":"            else:"},{"line_number":813,"context_line":"                _tmpfile.close()"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":"            self.reader_class \u003d buffered.BufferedReader"},{"line_number":816,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_0c390a42","line":813,"range":{"start_line":796,"start_character":0,"end_line":813,"end_character":32},"in_reply_to":"5a3905b3_e1b20e06","updated":"2017-01-24 20:57:50.000000000","message":"Sure Steve. But the goal was to fail fast. This would help us prevent a call to the reader in the first place in case of a bad configuration. i.e., even before an image upload is initiated, which might be good for a user.\nSo maybe we can group this into a private method here to make the code cleaner?\nLet me know what you think.","commit_id":"61c2c8aed7e7db27100a908519b44d5d24f1281d"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b484f1b181d0383f0f4dd48e67c41c6b220efb1e","unresolved":false,"context_lines":[{"line_number":791,"context_line":""},{"line_number":792,"context_line":"        if glance_conf.swift_buffer_on_upload:"},{"line_number":793,"context_line":"            buffer_dir \u003d glance_conf.swift_upload_buffer_dir"},{"line_number":794,"context_line":"            if buffered.validate_buffering(buffer_dir):"},{"line_number":795,"context_line":"                self.reader_class \u003d buffered.BufferedReader"},{"line_number":796,"context_line":"        else:"},{"line_number":797,"context_line":"            self.reader_class \u003d ChunkReader"}],"source_content_type":"text/x-python","patch_set":42,"id":"1a1ced50_5c7553f7","line":794,"updated":"2017-03-17 19:32:38.000000000","message":"The if feels a little awkward (like we might be left with an uninitialized reader_class), but I suppose validate_buffering always either returns True or raises an exception, so it shouldn\u0027t be a problem.","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"},{"author":{"_account_id":12807,"name":"Steve Lewis (stevelle)","email":"stevelle@gmail.com","username":"stevelle"},"change_message_id":"c36aedbb3ba0d82cc8069583f92a7e0c092da0a8","unresolved":false,"context_lines":[{"line_number":956,"context_line":"                            except Exception:"},{"line_number":957,"context_line":"                                # Delete orphaned segments from swift backend"},{"line_number":958,"context_line":"                                with excutils.save_and_reraise_exception():"},{"line_number":959,"context_line":"                                    LOG.error(_(\"Error during chunked upload \""},{"line_number":960,"context_line":"                                                \"to backend, deleting stale \""},{"line_number":961,"context_line":"                                                \"chunks.\"))"},{"line_number":962,"context_line":"                                    self._delete_stale_chunks("}],"source_content_type":"text/x-python","patch_set":42,"id":"1a1ced50_180ce793","line":959,"range":{"start_line":959,"start_character":40,"end_line":959,"end_character":45},"updated":"2017-03-17 01:34:24.000000000","message":"switching this to error was a good catch.","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"}],"glance_store/tests/unit/test_opts.py":[{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"eb8baddf29541ecb024123c662a1fb69a3f19ab3","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            \u0027swift_store_ssl_compression\u0027,"},{"line_number":123,"context_line":"            \u0027swift_store_use_trusts\u0027,"},{"line_number":124,"context_line":"            \u0027swift_store_user\u0027,"},{"line_number":125,"context_line":"            \u0027swift_buffer_on_upload\u0027,"},{"line_number":126,"context_line":"            \u0027vmware_insecure\u0027,"},{"line_number":127,"context_line":"            \u0027vmware_ca_file\u0027,"},{"line_number":128,"context_line":"            \u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_0406cdcd","line":125,"updated":"2017-01-16 18:31:52.000000000","message":"How come we didn\u0027t add the other config option ``swift_upload_buffer_dir`` here?","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6abb156356b17e78dee6fcc553b1435d8ac9caf7","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            \u0027swift_store_ssl_compression\u0027,"},{"line_number":123,"context_line":"            \u0027swift_store_use_trusts\u0027,"},{"line_number":124,"context_line":"            \u0027swift_store_user\u0027,"},{"line_number":125,"context_line":"            \u0027swift_buffer_on_upload\u0027,"},{"line_number":126,"context_line":"            \u0027vmware_insecure\u0027,"},{"line_number":127,"context_line":"            \u0027vmware_ca_file\u0027,"},{"line_number":128,"context_line":"            \u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_21d5781b","line":125,"in_reply_to":"7a3c09a3_0406cdcd","updated":"2017-01-16 19:15:11.000000000","message":"+1","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"f1a6a1818a0dc523d2d0a45c23a98888955511eb","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            \u0027swift_store_ssl_compression\u0027,"},{"line_number":123,"context_line":"            \u0027swift_store_use_trusts\u0027,"},{"line_number":124,"context_line":"            \u0027swift_store_user\u0027,"},{"line_number":125,"context_line":"            \u0027swift_buffer_on_upload\u0027,"},{"line_number":126,"context_line":"            \u0027vmware_insecure\u0027,"},{"line_number":127,"context_line":"            \u0027vmware_ca_file\u0027,"},{"line_number":128,"context_line":"            \u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_329788ed","line":125,"in_reply_to":"7a3c09a3_21d5781b","updated":"2017-01-16 20:37:13.000000000","message":"That options needs to be added here https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/swift/store.py#L727","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"550eb094e5ff199f38b8dcce9282685f73f7ad16","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            \u0027swift_store_ssl_compression\u0027,"},{"line_number":123,"context_line":"            \u0027swift_store_use_trusts\u0027,"},{"line_number":124,"context_line":"            \u0027swift_store_user\u0027,"},{"line_number":125,"context_line":"            \u0027swift_buffer_on_upload\u0027,"},{"line_number":126,"context_line":"            \u0027vmware_insecure\u0027,"},{"line_number":127,"context_line":"            \u0027vmware_ca_file\u0027,"},{"line_number":128,"context_line":"            \u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7a3c09a3_ca7e4b69","line":125,"in_reply_to":"7a3c09a3_329788ed","updated":"2017-01-17 21:14:01.000000000","message":"Done","commit_id":"44cf8216151ca0c05ddb09ca1629b791e08ec676"}],"glance_store/tests/unit/test_swift_store.py":[{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"f6822f66288112c187f18af0bde6c00b5fceacee","unresolved":false,"context_lines":[{"line_number":1982,"context_line":"        self.reader.__exit__(None, None, None)"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"    def test_buffer(self):"},{"line_number":1985,"context_line":"        # self.assertFalse(self.reader._buffered)"},{"line_number":1986,"context_line":"        self.reader.read(4)"},{"line_number":1987,"context_line":"        self.assertTrue(True, self.reader._buffered)"},{"line_number":1988,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_94e7efaa","line":1985,"updated":"2017-01-06 18:49:23.000000000","message":"Why is this commented out?","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"2f0329f8ec8085b634d00651b5b572147c145a1a","unresolved":false,"context_lines":[{"line_number":1982,"context_line":"        self.reader.__exit__(None, None, None)"},{"line_number":1983,"context_line":""},{"line_number":1984,"context_line":"    def test_buffer(self):"},{"line_number":1985,"context_line":"        # self.assertFalse(self.reader._buffered)"},{"line_number":1986,"context_line":"        self.reader.read(4)"},{"line_number":1987,"context_line":"        self.assertTrue(True, self.reader._buffered)"},{"line_number":1988,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba5201f7_d7869c15","line":1985,"in_reply_to":"ba5201f7_94e7efaa","updated":"2017-01-09 17:24:01.000000000","message":"Removing this line as the call to _buffer() happens with the SetUp we have anyway.\n\"buffered\" gets set to True regardless of whether it buffers the entire chunk or anything as big as \u003e0 bytes.","commit_id":"b4c4016408f4d4d4510e029765e3e5ed57420e2c"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2064,"context_line":"    def test_verifier(self):"},{"line_number":2065,"context_line":"        self.reader.read(7)"},{"line_number":2066,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2067,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2068,"context_line":"        self.reader.read(4)  # partial read"},{"line_number":2069,"context_line":"        # the verifier is updated with the next full chunk"},{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_cbad1133","line":2067,"range":{"start_line":2067,"start_character":8,"end_line":2067,"end_character":52},"updated":"2017-01-12 18:51:08.000000000","message":"If there intent here is to confirm that only one call has been made to verifier.update, we should use ``assert_called_once_with``.\nhttps://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.assert_called_once_with\n\n``assert_has_calls`` would only assert that a given call is among all the calls made to the method in question.","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"8b441b0d244a95d3c63275302c10138a890f276c","unresolved":false,"context_lines":[{"line_number":2064,"context_line":"    def test_verifier(self):"},{"line_number":2065,"context_line":"        self.reader.read(7)"},{"line_number":2066,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2067,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2068,"context_line":"        self.reader.read(4)  # partial read"},{"line_number":2069,"context_line":"        # the verifier is updated with the next full chunk"},{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_0eb020f4","line":2067,"range":{"start_line":2067,"start_character":8,"end_line":2067,"end_character":52},"in_reply_to":"9a57fde8_cbad1133","updated":"2017-01-13 02:20:56.000000000","message":"Done","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2065,"context_line":"        self.reader.read(7)"},{"line_number":2066,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2067,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2068,"context_line":"        self.reader.read(4)  # partial read"},{"line_number":2069,"context_line":"        # the verifier is updated with the next full chunk"},{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2071,"context_line":"        self.verifier.update.assert_has_calls(calls)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_0bb7193a","line":2068,"range":{"start_line":2068,"start_character":29,"end_line":2068,"end_character":43},"updated":"2017-01-12 18:51:08.000000000","message":"What is the partial read here?\nDidn\u0027t we read everything that there is to read with your first read?","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2068,"context_line":"        self.reader.read(4)  # partial read"},{"line_number":2069,"context_line":"        # the verifier is updated with the next full chunk"},{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2071,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2072,"context_line":""},{"line_number":2073,"context_line":"    def test_verifier_updates_on_seek(self):"},{"line_number":2074,"context_line":"        # Test that the verifier is updated correctly if the stream is reset."}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_6b6d0504","line":2071,"range":{"start_line":2071,"start_character":8,"end_line":2071,"end_character":52},"updated":"2017-01-12 18:51:08.000000000","message":"same as above","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2071,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2072,"context_line":""},{"line_number":2073,"context_line":"    def test_verifier_updates_on_seek(self):"},{"line_number":2074,"context_line":"        # Test that the verifier is updated correctly if the stream is reset."},{"line_number":2075,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2076,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_6b3b45ec","line":2073,"range":{"start_line":2073,"start_character":8,"end_line":2073,"end_character":37},"updated":"2017-01-12 18:51:08.000000000","message":"If I understand this test correctly, the verifier won\u0027t update on seek because we read the entire data in one read operation. Even if the upload fails, the verifier would still be ahead of the file pointer and there is  no need for it be updated because the verifier has already seen the entire  data.","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"8b441b0d244a95d3c63275302c10138a890f276c","unresolved":false,"context_lines":[{"line_number":2070,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2071,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2072,"context_line":""},{"line_number":2073,"context_line":"    def test_verifier_updates_on_seek(self):"},{"line_number":2074,"context_line":"        # Test that the verifier is updated correctly if the stream is reset."},{"line_number":2075,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2076,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_d140860a","line":2073,"range":{"start_line":2073,"start_character":8,"end_line":2073,"end_character":37},"in_reply_to":"9a57fde8_6b3b45ec","updated":"2017-01-13 02:20:56.000000000","message":"Bad naming of the test. In the tests, I am making sure that during seeks, our verify is not updating itself cos it already knows ahead. (Line 2080)","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2074,"context_line":"        # Test that the verifier is updated correctly if the stream is reset."},{"line_number":2075,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2076,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2077,"context_line":"        self.verifier.update.assert_has_calls(calls)  # verifier is updated"},{"line_number":2078,"context_line":"        self.reader.seek(4)  # seek back due to possible failure"},{"line_number":2079,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2080,"context_line":"        self.verifier.update.assert_has_calls(calls)  # verifier knows ahead"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_2b185d84","line":2077,"range":{"start_line":2077,"start_character":8,"end_line":2077,"end_character":52},"updated":"2017-01-12 18:51:08.000000000","message":"same as above","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2077,"context_line":"        self.verifier.update.assert_has_calls(calls)  # verifier is updated"},{"line_number":2078,"context_line":"        self.reader.seek(4)  # seek back due to possible failure"},{"line_number":2079,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2080,"context_line":"        self.verifier.update.assert_has_calls(calls)  # verifier knows ahead"},{"line_number":2081,"context_line":"        self.reader.read(5)  # continue from the byte position that failed"},{"line_number":2082,"context_line":"        # verifier and reader are in sync at the end of the chunk read"},{"line_number":2083,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_8b178950","line":2080,"range":{"start_line":2080,"start_character":8,"end_line":2080,"end_character":53},"updated":"2017-01-12 18:51:08.000000000","message":"same as above\n\nWe can probably do away with this assertion completely.\nWe can perform how many ever read and seek operations but at the end there should only be one call made to the verifier.\nSo, we can just do with one \"assert_called_once_with\" at the end.","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2081,"context_line":"        self.reader.read(5)  # continue from the byte position that failed"},{"line_number":2082,"context_line":"        # verifier and reader are in sync at the end of the chunk read"},{"line_number":2083,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2084,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2085,"context_line":"        buff \u003d self.reader._tmpfile"},{"line_number":2086,"context_line":"        buff.seek(0)"},{"line_number":2087,"context_line":"        self.assertEqual(b\u00271234567\u0027, buff.read())"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_ce935fa2","line":2084,"range":{"start_line":2084,"start_character":8,"end_line":2084,"end_character":52},"updated":"2017-01-12 18:51:08.000000000","message":"same as above","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2082,"context_line":"        # verifier and reader are in sync at the end of the chunk read"},{"line_number":2083,"context_line":"        calls \u003d [mock.call(b\u00271234567\u0027)]"},{"line_number":2084,"context_line":"        self.verifier.update.assert_has_calls(calls)"},{"line_number":2085,"context_line":"        buff \u003d self.reader._tmpfile"},{"line_number":2086,"context_line":"        buff.seek(0)"},{"line_number":2087,"context_line":"        self.assertEqual(b\u00271234567\u0027, buff.read())"},{"line_number":2088,"context_line":""},{"line_number":2089,"context_line":"    def test_verifier_rolling_call_count(self):"},{"line_number":2090,"context_line":"        self.reader.read(7)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_4ed5af41","line":2087,"range":{"start_line":2085,"start_character":8,"end_line":2087,"end_character":49},"updated":"2017-01-12 18:51:08.000000000","message":"What\u0027s the intent here?","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"623bfd2d3735bf5f8ca92ce10185f2e6fb9b74c3","unresolved":false,"context_lines":[{"line_number":2085,"context_line":"        buff \u003d self.reader._tmpfile"},{"line_number":2086,"context_line":"        buff.seek(0)"},{"line_number":2087,"context_line":"        self.assertEqual(b\u00271234567\u0027, buff.read())"},{"line_number":2088,"context_line":""},{"line_number":2089,"context_line":"    def test_verifier_rolling_call_count(self):"},{"line_number":2090,"context_line":"        self.reader.read(7)"},{"line_number":2091,"context_line":"        self.assertEqual(1, self.verifier.update.call_count)"}],"source_content_type":"text/x-python","patch_set":27,"id":"9a57fde8_cef6ffd6","line":2088,"updated":"2017-01-12 18:51:08.000000000","message":"Also, I think we need another test where the verifier is not updated all the way in one operation. Basically to test a scenario where verifier stays in sync until a certain point, then goes ahead due to a seek, then gets back in sync again.","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"8b441b0d244a95d3c63275302c10138a890f276c","unresolved":false,"context_lines":[{"line_number":2085,"context_line":"        buff \u003d self.reader._tmpfile"},{"line_number":2086,"context_line":"        buff.seek(0)"},{"line_number":2087,"context_line":"        self.assertEqual(b\u00271234567\u0027, buff.read())"},{"line_number":2088,"context_line":""},{"line_number":2089,"context_line":"    def test_verifier_rolling_call_count(self):"},{"line_number":2090,"context_line":"        self.reader.read(7)"},{"line_number":2091,"context_line":"        self.assertEqual(1, self.verifier.update.call_count)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_eeaaf484","line":2088,"in_reply_to":"9a57fde8_cef6ffd6","updated":"2017-01-13 02:20:56.000000000","message":"Done","commit_id":"fedaf390fcf8ea5ce74f97c9a2e4eb412182d329"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"        csum.update(b\u002712345\u0027)  # this update happens in our caller - add()"},{"line_number":2062,"context_line":"        self.assertEqual(csum.hexdigest(), self.reader.checksum.hexdigest())"},{"line_number":2063,"context_line":""},{"line_number":2064,"context_line":"    def test_verifier(self):"},{"line_number":2065,"context_line":"        self.reader.read(7)"},{"line_number":2066,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2067,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_72b089f5","line":2064,"updated":"2017-01-13 16:20:25.000000000","message":"Let\u0027s add a short description for this test as well.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2061,"context_line":"        csum.update(b\u002712345\u0027)  # this update happens in our caller - add()"},{"line_number":2062,"context_line":"        self.assertEqual(csum.hexdigest(), self.reader.checksum.hexdigest())"},{"line_number":2063,"context_line":""},{"line_number":2064,"context_line":"    def test_verifier(self):"},{"line_number":2065,"context_line":"        self.reader.read(7)"},{"line_number":2066,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2067,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_03e53536","line":2064,"in_reply_to":"7a3c09a3_72b089f5","updated":"2017-01-13 17:16:51.000000000","message":"Done","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2066,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"    def test_verifier_updated_only_once_w_full_segment_read(self):"},{"line_number":2069,"context_line":"        # Test that the verifier is updated only once on a full segment read."},{"line_number":2070,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2071,"context_line":"        self.reader.seek(4)  # seek back due to possible partial failure"},{"line_number":2072,"context_line":"        self.reader.read(5)  # continue reading"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_12b665dc","line":2069,"range":{"start_line":2069,"start_character":8,"end_line":2069,"end_character":77},"updated":"2017-01-13 16:20:25.000000000","message":"This description sounds more appropriate for the previous test case. How about adding a bit more description about what we are exactly testing here. \n\nHow about something like \"Test that verifier is updated only once when a full read operation is followed by a seek and partial read operations\"?\n\nOr something on those lines.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2066,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2067,"context_line":""},{"line_number":2068,"context_line":"    def test_verifier_updated_only_once_w_full_segment_read(self):"},{"line_number":2069,"context_line":"        # Test that the verifier is updated only once on a full segment read."},{"line_number":2070,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2071,"context_line":"        self.reader.seek(4)  # seek back due to possible partial failure"},{"line_number":2072,"context_line":"        self.reader.read(5)  # continue reading"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_e3e7493e","line":2069,"range":{"start_line":2069,"start_character":8,"end_line":2069,"end_character":77},"in_reply_to":"7a3c09a3_12b665dc","updated":"2017-01-13 17:16:51.000000000","message":"Done","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2074,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2075,"context_line":""},{"line_number":2076,"context_line":"    def test_verifier_updates_during_partial_segment_reads(self):"},{"line_number":2077,"context_line":"        # Test to check that verifier is updated with only the bytes it might"},{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_72ec09c8","line":2078,"range":{"start_line":2077,"start_character":72,"end_line":2078,"end_character":18},"updated":"2017-01-13 16:20:25.000000000","message":"has not?","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2074,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2075,"context_line":""},{"line_number":2076,"context_line":"    def test_verifier_updates_during_partial_segment_reads(self):"},{"line_number":2077,"context_line":"        # Test to check that verifier is updated with only the bytes it might"},{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_23d07153","line":2078,"range":{"start_line":2077,"start_character":72,"end_line":2078,"end_character":18},"in_reply_to":"7a3c09a3_72ec09c8","updated":"2017-01-13 17:16:51.000000000","message":"Done","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2076,"context_line":"    def test_verifier_updates_during_partial_segment_reads(self):"},{"line_number":2077,"context_line":"        # Test to check that verifier is updated with only the bytes it might"},{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_d24bfd57","line":2079,"range":{"start_line":2079,"start_character":8,"end_line":2079,"end_character":25},"updated":"2017-01-13 16:20:25.000000000","message":"Like we discussed earlier, swiftclient doesn\u0027t change its read size. This is just a hypothetical case to ensure that verifier works as expected even with varying read sizes. Let\u0027s drop the mention of swiftclient here to avoid confusion.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2076,"context_line":"    def test_verifier_updates_during_partial_segment_reads(self):"},{"line_number":2077,"context_line":"        # Test to check that verifier is updated with only the bytes it might"},{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_43d57d41","line":2079,"range":{"start_line":2079,"start_character":8,"end_line":2079,"end_character":25},"in_reply_to":"7a3c09a3_d24bfd57","updated":"2017-01-13 17:16:51.000000000","message":"Done","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_f24b99ae","line":2081,"range":{"start_line":2081,"start_character":8,"end_line":2081,"end_character":56},"updated":"2017-01-13 16:20:25.000000000","message":"Can we use self.verifier.update.assert_called_once_with(b\u00271234\u0027)?\nThat way you are verifying both the number of calls and the call itself.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2078,"context_line":"        # not have seen when the number of bytes being read is changed"},{"line_number":2079,"context_line":"        # on swift-client"},{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_6309992c","line":2081,"range":{"start_line":2081,"start_character":8,"end_line":2081,"end_character":56},"in_reply_to":"7a3c09a3_f24b99ae","updated":"2017-01-13 17:16:51.000000000","message":"Done","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"},{"line_number":2085,"context_line":"        # verifier updated with only the bytes it did not see"},{"line_number":2086,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # veriffier updated"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_52354d44","line":2083,"updated":"2017-01-13 16:20:25.000000000","message":"maybe another called once assert here? self.verifier.update.assert_called_once_with(b\u00271234\u0027)\n\nI know said that we don\u0027t need multiple asserts in the previous PS, but it seems to make sense here. What do you think?","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2080,"context_line":"        self.reader.read(4)"},{"line_number":2081,"context_line":"        self.verifier.update.assert_called_with(b\u00271234\u0027)"},{"line_number":2082,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"},{"line_number":2085,"context_line":"        # verifier updated with only the bytes it did not see"},{"line_number":2086,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # veriffier updated"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_c8098c33","line":2083,"in_reply_to":"7a3c09a3_52354d44","updated":"2017-01-13 17:16:51.000000000","message":"I agree. Though it re-iterates the same thing, it does bring clarity. Will add it.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"0bedd3a57f6afae00556ac9fbde32fecdefed7cc","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"},{"line_number":2085,"context_line":"        # verifier updated with only the bytes it did not see"},{"line_number":2086,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # veriffier updated"},{"line_number":2087,"context_line":""},{"line_number":2088,"context_line":"    def test_verifier_rolling_call_count(self):"},{"line_number":2089,"context_line":"        self.reader.read(7)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_926895bc","line":2086,"updated":"2017-01-13 16:20:25.000000000","message":"let\u0027s also assert that verifier.update has been called exactly twice using call_count.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"7c30a5f90d5ce591095c339628897be5c12b3311","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        self.reader.read(2)  # verifier knows ahead"},{"line_number":2084,"context_line":"        self.reader.read(4)  # verify missing 2 bytes"},{"line_number":2085,"context_line":"        # verifier updated with only the bytes it did not see"},{"line_number":2086,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # veriffier updated"},{"line_number":2087,"context_line":""},{"line_number":2088,"context_line":"    def test_verifier_rolling_call_count(self):"},{"line_number":2089,"context_line":"        self.reader.read(7)"}],"source_content_type":"text/x-python","patch_set":28,"id":"7a3c09a3_e806481f","line":2086,"in_reply_to":"7a3c09a3_926895bc","updated":"2017-01-13 17:16:51.000000000","message":"Good idea.","commit_id":"5a023994eabc9b3032dca5eb9044ee83893d211b"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"74afaf3e9e9831c6853c280edae157b6be8c57a5","unresolved":false,"context_lines":[{"line_number":2088,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # verifier updated"},{"line_number":2089,"context_line":"        self.assertEqual(2, self.verifier.update.call_count)"},{"line_number":2090,"context_line":""},{"line_number":2091,"context_line":"    def test_verifier_rolling_calls(self):"},{"line_number":2092,"context_line":"        # Test that the verifier continues on to the next segment"},{"line_number":2093,"context_line":"        self.reader.read(7)"},{"line_number":2094,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2095,"context_line":"        self.assertEqual(1, self.verifier.update.call_count)"},{"line_number":2096,"context_line":"        # another reader to complete reading the image file"},{"line_number":2097,"context_line":"        reader1 \u003d buffered.BufferedReader(self.infile, self.checksum, 3,"},{"line_number":2098,"context_line":"                                          self.reader.verifier)"},{"line_number":2099,"context_line":"        reader1.read(3)"},{"line_number":2100,"context_line":"        self.verifier.update.assert_called_with(b\u0027890\u0027)"},{"line_number":2101,"context_line":"        self.assertEqual(2, self.verifier.update.call_count)"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"    def test_light_buffer(self):"},{"line_number":2104,"context_line":"        # eventlet nonblocking fds means sometimes the buffer won\u0027t fill."}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_26e5dc08","line":2101,"range":{"start_line":2091,"start_character":0,"end_line":2101,"end_character":60},"updated":"2017-01-13 18:43:49.000000000","message":"I like this test :)","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"4000433b7d0d6c2d037e266b461cda76c6a421aa","unresolved":false,"context_lines":[{"line_number":2088,"context_line":"        self.verifier.update.assert_called_with(b\u002756\u0027)  # verifier updated"},{"line_number":2089,"context_line":"        self.assertEqual(2, self.verifier.update.call_count)"},{"line_number":2090,"context_line":""},{"line_number":2091,"context_line":"    def test_verifier_rolling_calls(self):"},{"line_number":2092,"context_line":"        # Test that the verifier continues on to the next segment"},{"line_number":2093,"context_line":"        self.reader.read(7)"},{"line_number":2094,"context_line":"        self.verifier.update.assert_called_once_with(b\u00271234567\u0027)"},{"line_number":2095,"context_line":"        self.assertEqual(1, self.verifier.update.call_count)"},{"line_number":2096,"context_line":"        # another reader to complete reading the image file"},{"line_number":2097,"context_line":"        reader1 \u003d buffered.BufferedReader(self.infile, self.checksum, 3,"},{"line_number":2098,"context_line":"                                          self.reader.verifier)"},{"line_number":2099,"context_line":"        reader1.read(3)"},{"line_number":2100,"context_line":"        self.verifier.update.assert_called_with(b\u0027890\u0027)"},{"line_number":2101,"context_line":"        self.assertEqual(2, self.verifier.update.call_count)"},{"line_number":2102,"context_line":""},{"line_number":2103,"context_line":"    def test_light_buffer(self):"},{"line_number":2104,"context_line":"        # eventlet nonblocking fds means sometimes the buffer won\u0027t fill."}],"source_content_type":"text/x-python","patch_set":29,"id":"7a3c09a3_14664aed","line":2101,"range":{"start_line":2091,"start_character":0,"end_line":2101,"end_character":60},"in_reply_to":"7a3c09a3_26e5dc08","updated":"2017-01-13 19:45:09.000000000","message":":)","commit_id":"bcf7a1e94410bf24c2ad6a547252500dce8d3f94"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":369,"context_line":"        self.config(swift_upload_buffer_dir\u003d\"/some/path\")"},{"line_number":370,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":371,"context_line":"        try:"},{"line_number":372,"context_line":"            self.store.configure()"},{"line_number":373,"context_line":"        except exceptions.SwiftBufferedReaderError as err:"},{"line_number":374,"context_line":"            exception_caught \u003d True"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_8feb40db","line":371,"updated":"2017-01-18 16:29:52.000000000","message":"How about setting  \"exception_caught \u003d False\" here?","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":369,"context_line":"        self.config(swift_upload_buffer_dir\u003d\"/some/path\")"},{"line_number":370,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":371,"context_line":"        try:"},{"line_number":372,"context_line":"            self.store.configure()"},{"line_number":373,"context_line":"        except exceptions.SwiftBufferedReaderError as err:"},{"line_number":374,"context_line":"            exception_caught \u003d True"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_14af5c2c","line":371,"in_reply_to":"7a3c09a3_8feb40db","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"ba6efe6a57b9931b85c17ae34b650df1810aaa16","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":380,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":381,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":382,"context_line":"        try:"},{"line_number":383,"context_line":"            self.store.configure()"},{"line_number":384,"context_line":"        except exceptions.SwiftBufferedReaderError as err:"},{"line_number":385,"context_line":"            exception_caught \u003d True"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_4fccf888","line":382,"updated":"2017-01-18 16:29:52.000000000","message":"same","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"e7aec26eec83a304748e18ae7e496ddc926a9a8c","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":380,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":381,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":382,"context_line":"        try:"},{"line_number":383,"context_line":"            self.store.configure()"},{"line_number":384,"context_line":"        except exceptions.SwiftBufferedReaderError as err:"},{"line_number":385,"context_line":"            exception_caught \u003d True"}],"source_content_type":"text/x-python","patch_set":32,"id":"7a3c09a3_54a9e423","line":382,"in_reply_to":"7a3c09a3_4fccf888","updated":"2017-01-18 18:38:03.000000000","message":"Done","commit_id":"5e9b58a3c3fa39d60945d3d0f766ae799961cb98"},{"author":{"_account_id":8158,"name":"Hemanth Makkapati","email":"makstacker+osgerrit@gmail.com","username":"hemanth.makkapati"},"change_message_id":"9e318572c54b037d44b360548be8c3ffcfdc6b45","unresolved":false,"context_lines":[{"line_number":390,"context_line":"            self.assertIn(\u0027Store swift could not be configured correctly. \u0027"},{"line_number":391,"context_line":"                          \u0027Reason: Configuration option \"swift_upload_buffer_\u0027"},{"line_number":392,"context_line":"                          \u0027dir\" is not set. Please set it to a valid path to \u0027"},{"line_number":393,"context_line":"                          \u0027buffer on during Swift uploads.\u0027,"},{"line_number":394,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":395,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_97ceeeb5","line":393,"range":{"start_line":393,"start_character":34,"end_line":393,"end_character":43},"updated":"2017-01-18 18:48:17.000000000","message":"same","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"434d280d84644a4e1fc14f82343138e782c32327","unresolved":false,"context_lines":[{"line_number":390,"context_line":"            self.assertIn(\u0027Store swift could not be configured correctly. \u0027"},{"line_number":391,"context_line":"                          \u0027Reason: Configuration option \"swift_upload_buffer_\u0027"},{"line_number":392,"context_line":"                          \u0027dir\" is not set. Please set it to a valid path to \u0027"},{"line_number":393,"context_line":"                          \u0027buffer on during Swift uploads.\u0027,"},{"line_number":394,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":395,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"7a3c09a3_a23566a9","line":393,"range":{"start_line":393,"start_character":34,"end_line":393,"end_character":43},"in_reply_to":"7a3c09a3_97ceeeb5","updated":"2017-01-18 18:55:13.000000000","message":"Done","commit_id":"46d7ceb051947e78969be9d65fe6119f53965ec5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"535bd860bd07f3a50a93c3be5b7b41daec99ade3","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_50247ec5","line":380,"updated":"2017-01-19 00:34:16.000000000","message":"Why not use assertRaises?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"2d1ff4d3937a3c69ca02ae3777f60fdc9b6f4375","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_e1d1f7fc","line":380,"in_reply_to":"5a3905b3_48faf043","updated":"2017-01-19 22:34:30.000000000","message":"Due to differences in Python versions compatibility with unit tests, there are issues with this suggestion with respect to assertRaises. I am okay doing  just an assertRaises check without the error msg check.\nSomething like just: self.assertRaises(exceptions.BadStoreConfiguration, self.store.configure) if you think checking for the error message is unnecessary.","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"bfe789e699b16745a83ccbeac06c78d7b88c46fa","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_48faf043","line":380,"in_reply_to":"5a3905b3_bfc1d682","updated":"2017-01-19 21:29:13.000000000","message":"We can do something like\n\n with self.assertRaises(exceptions.BadStoreConfiguration) as exc_mgr:\n     self.store.configure()\n self.assertIn(..., encodeutils.exception_to_unicode(exc_mgr.exception))","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"78f4d46685f4f26fac7655ff6c99c10a3d26e4ec","unresolved":false,"context_lines":[{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":35,"id":"5a3905b3_bfc1d682","line":380,"in_reply_to":"7a3c09a3_50247ec5","updated":"2017-01-19 21:01:20.000000000","message":"I thought this way we can catch the exact error with the message to assert. Do you suggest it is unnecessary?","commit_id":"d5f4e62fbbb8b945b18c4ee453b1c770232e943e"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"1e81e0bcca16b2f5499ee76e7025f3981743efe4","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":369,"context_line":"        self.config(swift_upload_buffer_dir\u003d\"/some/path\")"},{"line_number":370,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":371,"context_line":"        try:"},{"line_number":372,"context_line":"            exception_caught \u003d False"},{"line_number":373,"context_line":"            self.store.configure()"},{"line_number":374,"context_line":"        except exceptions.BadStoreConfiguration as err:"},{"line_number":375,"context_line":"            exception_caught \u003d True"},{"line_number":376,"context_line":"            self.assertIn(\u0027Store swift could not be configured correctly. \u0027"},{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_e06d3599","line":380,"range":{"start_line":371,"start_character":7,"end_line":380,"end_character":41},"updated":"2017-01-20 21:34:06.000000000","message":"Want opinion on whether this is necessary (checking error message too) or we just do a:\n\"self.assertRaises(exceptions.BadStoreConfiguration, self.store.configure)","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"ad33784c85b6279125bd9e4176677cdc139332f5","unresolved":false,"context_lines":[{"line_number":368,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":369,"context_line":"        self.config(swift_upload_buffer_dir\u003d\"/some/path\")"},{"line_number":370,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":371,"context_line":"        try:"},{"line_number":372,"context_line":"            exception_caught \u003d False"},{"line_number":373,"context_line":"            self.store.configure()"},{"line_number":374,"context_line":"        except exceptions.BadStoreConfiguration as err:"},{"line_number":375,"context_line":"            exception_caught \u003d True"},{"line_number":376,"context_line":"            self.assertIn(\u0027Store swift could not be configured correctly. \u0027"},{"line_number":377,"context_line":"                          \u0027Reason: Unable to use buffer directory set with \u0027"},{"line_number":378,"context_line":"                          \u0027\"swift_upload_buffer_dir\".\u0027,"},{"line_number":379,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":380,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_cf1b021a","line":380,"range":{"start_line":371,"start_character":7,"end_line":380,"end_character":41},"in_reply_to":"5a3905b3_e06d3599","updated":"2017-01-21 00:25:49.000000000","message":"I\u0027m not a big fan of testing messages. At most, I\u0027d maybe just make sure it\u0027s raising the correct exception.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"1e81e0bcca16b2f5499ee76e7025f3981743efe4","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def test_buffered_reader_with_no_path_given(self):"},{"line_number":383,"context_line":"        self.config(swift_buffer_on_upload\u003dTrue)"},{"line_number":384,"context_line":"        self.store \u003d Store(self.conf)"},{"line_number":385,"context_line":"        try:"},{"line_number":386,"context_line":"            exception_caught \u003d False"},{"line_number":387,"context_line":"            self.store.configure()"},{"line_number":388,"context_line":"        except exceptions.BadStoreConfiguration as err:"},{"line_number":389,"context_line":"            exception_caught \u003d True"},{"line_number":390,"context_line":"            self.assertIn(\u0027Store swift could not be configured correctly. \u0027"},{"line_number":391,"context_line":"                          \u0027Reason: Configuration option \"swift_upload_buffer_\u0027"},{"line_number":392,"context_line":"                          \u0027dir\" is not set. Please set it to a valid path to \u0027"},{"line_number":393,"context_line":"                          \u0027buffer during Swift uploads.\u0027,"},{"line_number":394,"context_line":"                          encodeutils.exception_to_unicode(err))"},{"line_number":395,"context_line":"        self.assertTrue(exception_caught)"},{"line_number":396,"context_line":""},{"line_number":397,"context_line":"    @mock.patch(\u0027glance_store._drivers.swift.utils\u0027"},{"line_number":398,"context_line":"                \u0027.is_multiple_swift_store_accounts_enabled\u0027,"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_0069618b","line":395,"range":{"start_line":385,"start_character":0,"end_line":395,"end_character":41},"updated":"2017-01-20 21:34:06.000000000","message":"same as above.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e135cba2113dc57b731c926be451ea1b6f87be7b","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2084,"context_line":"        self.reader.seek(4)  # seek back due to possible partial failure"},{"line_number":2085,"context_line":"        self.reader.read(5)  # continue reading"},{"line_number":2086,"context_line":"        # checksum was updated just once during the first attempted full read"},{"line_number":2087,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2088,"context_line":""},{"line_number":2089,"context_line":"    def test_checksum_updates_during_partial_segment_reads(self):"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_38fea937","line":2086,"updated":"2017-01-20 15:17:15.000000000","message":"Are we really checking that the checksum is only updated once or just that it\u0027s correct given a partial failure and partial re-read?","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"1e81e0bcca16b2f5499ee76e7025f3981743efe4","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        self.reader.read(7)  # attempted read of the entire chunk"},{"line_number":2084,"context_line":"        self.reader.seek(4)  # seek back due to possible partial failure"},{"line_number":2085,"context_line":"        self.reader.read(5)  # continue reading"},{"line_number":2086,"context_line":"        # checksum was updated just once during the first attempted full read"},{"line_number":2087,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2088,"context_line":""},{"line_number":2089,"context_line":"    def test_checksum_updates_during_partial_segment_reads(self):"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_5167c224","line":2086,"in_reply_to":"5a3905b3_38fea937","updated":"2017-01-20 21:34:06.000000000","message":"Will updating the second read to read just one more byte to address this question. Thanks Jesse.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"e135cba2113dc57b731c926be451ea1b6f87be7b","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        self.reader.read(4)"},{"line_number":2094,"context_line":"        expected_csum.update(b\u00271234\u0027)"},{"line_number":2095,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2096,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2097,"context_line":"        self.reader.read(2)"},{"line_number":2098,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2099,"context_line":"        self.reader.read(4)  # checksum missing two bytes"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_f85fc13e","line":2096,"updated":"2017-01-20 15:17:15.000000000","message":"Would it be useful to have a similar test that doesn\u0027t seek all the way back to 0 as well?","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":11642,"name":"Jesse J. Cook","email":"jesse.cook@rackspace.com","username":"crashenx"},"change_message_id":"31c036ac7d37daa65106a607c971b9053ec43bf9","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        self.reader.read(4)"},{"line_number":2094,"context_line":"        expected_csum.update(b\u00271234\u0027)"},{"line_number":2095,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2096,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2097,"context_line":"        self.reader.read(2)"},{"line_number":2098,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2099,"context_line":"        self.reader.read(4)  # checksum missing two bytes"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_635b0f88","line":2096,"in_reply_to":"5a3905b3_ec0451c1","updated":"2017-01-20 22:09:06.000000000","message":"I was mostly interested if the reader would behave differently when seeking somewhere other than the beginning. I guess it doesn\u0027t matter since it depends on the underlying iterator returned from the backend and a test at this level wouldn\u0027t check that.","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":21722,"name":"Dharini Chandrasekar","email":"dharini.chandrasekar@intel.com","username":"dharinic"},"change_message_id":"1e81e0bcca16b2f5499ee76e7025f3981743efe4","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        self.reader.read(4)"},{"line_number":2094,"context_line":"        expected_csum.update(b\u00271234\u0027)"},{"line_number":2095,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2096,"context_line":"        self.reader.seek(0)  # possible failure"},{"line_number":2097,"context_line":"        self.reader.read(2)"},{"line_number":2098,"context_line":"        self.assertEqual(expected_csum.hexdigest(), self.checksum.hexdigest())"},{"line_number":2099,"context_line":"        self.reader.read(4)  # checksum missing two bytes"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_ec0451c1","line":2096,"in_reply_to":"5a3905b3_f85fc13e","updated":"2017-01-20 21:34:06.000000000","message":"Yes Jesse. We can have one such test, although it doesnt assert anything very different. Seeking back partially will mean the update on L2100 will be \u0027567\u0027 in this particular test. I did not add one such test cos I thought it might be redundant. Do you suggest we add?","commit_id":"281e7d560318938df69e08266bd735d2c5326cc4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"373e044634cae48ef2084ed0fde8cd4a2c738b14","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            service_catalog\u003dservice_catalog)"},{"line_number":479,"context_line":"        store \u003d swift.MultiTenantStore(self.conf)"},{"line_number":480,"context_line":"        store.configure()"},{"line_number":481,"context_line":"        loc, size, checksum, _ \u003d store.add(expected_image_id,"},{"line_number":482,"context_line":"                                           image_swift,"},{"line_number":483,"context_line":"                                           expected_swift_size,"},{"line_number":484,"context_line":"                                           context\u003dctxt)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1f1a1f67_3e3c0dc7","line":481,"updated":"2017-07-13 17:27:49.000000000","message":"any reason for this change, seems unrelated","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"373e044634cae48ef2084ed0fde8cd4a2c738b14","unresolved":false,"context_lines":[{"line_number":520,"context_line":"            self.mock_keystone_client()"},{"line_number":521,"context_line":"            self.store \u003d Store(self.conf)"},{"line_number":522,"context_line":"            self.store.configure()"},{"line_number":523,"context_line":"            loc, size, checksum, _ \u003d self.store.add(image_id,"},{"line_number":524,"context_line":"                                                    image_swift,"},{"line_number":525,"context_line":"                                                    expected_swift_size)"},{"line_number":526,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"1f1a1f67_be8ffd21","line":523,"updated":"2017-07-13 17:27:49.000000000","message":"ditto","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"373e044634cae48ef2084ed0fde8cd4a2c738b14","unresolved":false,"context_lines":[{"line_number":828,"context_line":"            service_catalog\u003dservice_catalog)"},{"line_number":829,"context_line":"        store \u003d swift.MultiTenantStore(self.conf)"},{"line_number":830,"context_line":"        store.configure()"},{"line_number":831,"context_line":"        location, size, checksum, _ \u003d store.add(expected_image_id,"},{"line_number":832,"context_line":"                                                image_swift,"},{"line_number":833,"context_line":"                                                expected_swift_size,"},{"line_number":834,"context_line":"                                                context\u003dctxt)"}],"source_content_type":"text/x-python","patch_set":42,"id":"1f1a1f67_3ea3eda0","line":831,"updated":"2017-07-13 17:27:49.000000000","message":"ditto","commit_id":"2e0024c85ca2ddf380014e44213be4fb876f680e"}]}
