)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0f01774e5b5c98ccceedbbec59fe0c3fab2c8198","unresolved":false,"context_lines":[{"line_number":21,"context_line":"environment, it gave this result for an upload of 6 Gbpson a replica"},{"line_number":22,"context_line":"policy (average of 3 runs):"},{"line_number":23,"context_line":"    master: 5.66 Gbps / 849 jiffies consumed by the proxy-server"},{"line_number":24,"context_line":"    this patch: 7.56 Gbps / 618 jiffies consumed by the proxy-server"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I19fd42908be5a6ac5905ba193967cd860cb27a0b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"df33271e_219d8fbb","line":24,"updated":"2020-04-03 12:20:28.000000000","message":"I mean look, I haven\u0027t confirmed these numbers or anything - but I trust Romain and this is HUGE!","commit_id":"8378a11d1113386326841ef7065914dd1629a15f"}],"swift/common/utils.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1539b45ff6ccf56b4e5a44eefdabefbac62657f2","unresolved":false,"context_lines":[{"line_number":5795,"context_line":"    return sorted(results)"},{"line_number":5796,"context_line":""},{"line_number":5797,"context_line":""},{"line_number":5798,"context_line":"class Watchdog(object):"},{"line_number":5799,"context_line":"    def __init__(self):"},{"line_number":5800,"context_line":"        # key \u003d\u003e (timeout, timeout_at, caller_greenthread, exception)"},{"line_number":5801,"context_line":"        self._timeouts \u003d dict()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_98fb9ebd","line":5798,"updated":"2019-12-09 11:06:07.000000000","message":"please add docstrings","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"49fec1c48551806bc2b98b1853aba97b45ccaba4","unresolved":false,"context_lines":[{"line_number":5795,"context_line":"    return sorted(results)"},{"line_number":5796,"context_line":""},{"line_number":5797,"context_line":""},{"line_number":5798,"context_line":"class Watchdog(object):"},{"line_number":5799,"context_line":"    def __init__(self):"},{"line_number":5800,"context_line":"        # key \u003d\u003e (timeout, timeout_at, caller_greenthread, exception)"},{"line_number":5801,"context_line":"        self._timeouts \u003d dict()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_25834c58","line":5798,"in_reply_to":"3fa7e38b_98fb9ebd","updated":"2019-12-10 15:44:33.000000000","message":"Done","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1539b45ff6ccf56b4e5a44eefdabefbac62657f2","unresolved":false,"context_lines":[{"line_number":5831,"context_line":"            pass"},{"line_number":5832,"context_line":""},{"line_number":5833,"context_line":"    @contextmanager"},{"line_number":5834,"context_line":"    def timeout(self, timeout, exc):"},{"line_number":5835,"context_line":"        key \u003d self.start(timeout, exc)"},{"line_number":5836,"context_line":"        yield"},{"line_number":5837,"context_line":"        self.stop(key)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_98e95ee5","line":5834,"range":{"start_line":5834,"start_character":8,"end_line":5834,"end_character":15},"updated":"2019-12-09 11:06:07.000000000","message":"when is this called?","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"49fec1c48551806bc2b98b1853aba97b45ccaba4","unresolved":false,"context_lines":[{"line_number":5831,"context_line":"            pass"},{"line_number":5832,"context_line":""},{"line_number":5833,"context_line":"    @contextmanager"},{"line_number":5834,"context_line":"    def timeout(self, timeout, exc):"},{"line_number":5835,"context_line":"        key \u003d self.start(timeout, exc)"},{"line_number":5836,"context_line":"        yield"},{"line_number":5837,"context_line":"        self.stop(key)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_a5965c93","line":5834,"range":{"start_line":5834,"start_character":8,"end_line":5834,"end_character":15},"in_reply_to":"3fa7e38b_98e95ee5","updated":"2019-12-10 15:44:33.000000000","message":"It was a leftover from the initial implementation. It turns out performance of @contextmanager are terrible while a \"real\" context manager is really close to just calling start()/stop(). I removed it.","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1539b45ff6ccf56b4e5a44eefdabefbac62657f2","unresolved":false,"context_lines":[{"line_number":5871,"context_line":""},{"line_number":5872,"context_line":""},{"line_number":5873,"context_line":"class WatchdogTimeout(object):"},{"line_number":5874,"context_line":"    def __init__(self, watchdog, timeout, exc, timeout_at\u003dNone):"},{"line_number":5875,"context_line":"        self.watchdog \u003d watchdog"},{"line_number":5876,"context_line":"        self.key \u003d watchdog.start(timeout, exc, timeout_at\u003dtimeout_at)"},{"line_number":5877,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_18d6ce27","line":5874,"range":{"start_line":5874,"start_character":42,"end_line":5874,"end_character":45},"updated":"2019-12-09 11:06:07.000000000","message":"how about raising a WatchdogTimeoutException instead? wondering if it would simplify the interface","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1539b45ff6ccf56b4e5a44eefdabefbac62657f2","unresolved":false,"context_lines":[{"line_number":5871,"context_line":""},{"line_number":5872,"context_line":""},{"line_number":5873,"context_line":"class WatchdogTimeout(object):"},{"line_number":5874,"context_line":"    def __init__(self, watchdog, timeout, exc, timeout_at\u003dNone):"},{"line_number":5875,"context_line":"        self.watchdog \u003d watchdog"},{"line_number":5876,"context_line":"        self.key \u003d watchdog.start(timeout, exc, timeout_at\u003dtimeout_at)"},{"line_number":5877,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_18f9ee80","line":5874,"range":{"start_line":5874,"start_character":47,"end_line":5874,"end_character":57},"updated":"2019-12-09 11:06:07.000000000","message":"it\u0027s not clear to me why both timeout and timeout_at are needed. Basically in the end you really want timeout_at, but you derive that from timeout, did I get that right?","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"49fec1c48551806bc2b98b1853aba97b45ccaba4","unresolved":false,"context_lines":[{"line_number":5871,"context_line":""},{"line_number":5872,"context_line":""},{"line_number":5873,"context_line":"class WatchdogTimeout(object):"},{"line_number":5874,"context_line":"    def __init__(self, watchdog, timeout, exc, timeout_at\u003dNone):"},{"line_number":5875,"context_line":"        self.watchdog \u003d watchdog"},{"line_number":5876,"context_line":"        self.key \u003d watchdog.start(timeout, exc, timeout_at\u003dtimeout_at)"},{"line_number":5877,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_a5c41c93","line":5874,"range":{"start_line":5874,"start_character":42,"end_line":5874,"end_character":45},"in_reply_to":"3fa7e38b_18d6ce27","updated":"2019-12-10 15:44:33.000000000","message":"It would simplify it but:\n1. it would change the \"interface\" of the current code (not a big deal IMHO)\n2. it would require to pass a new param (a string) that allow to log a useful message, this is currently taken care of by the various *Timeout classes\n3. it would make it difficult to imbricate different timeout (thus, we don\u0027t do that currently I think, so may not be a concern)\n\nI think the main point is 2","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"49fec1c48551806bc2b98b1853aba97b45ccaba4","unresolved":false,"context_lines":[{"line_number":5871,"context_line":""},{"line_number":5872,"context_line":""},{"line_number":5873,"context_line":"class WatchdogTimeout(object):"},{"line_number":5874,"context_line":"    def __init__(self, watchdog, timeout, exc, timeout_at\u003dNone):"},{"line_number":5875,"context_line":"        self.watchdog \u003d watchdog"},{"line_number":5876,"context_line":"        self.key \u003d watchdog.start(timeout, exc, timeout_at\u003dtimeout_at)"},{"line_number":5877,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_e5d77421","line":5874,"range":{"start_line":5874,"start_character":47,"end_line":5874,"end_character":57},"in_reply_to":"3fa7e38b_18f9ee80","updated":"2019-12-10 15:44:33.000000000","message":"In some situations you want to synchronize expirations, so you calculate it before but you still pass the timeout value to have a \"nice\" error message. Example: when reading from multiple socket at the same time, if it takes 2 seconds each, you don\u0027t want to whole operation to take more than 10 seconds. you calculate 10 seconds at the begining, then you pass this for each call (does it make sense?)","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"c6ebc0d362246b7d497b4be59565abb70fd59229","unresolved":false,"context_lines":[{"line_number":5910,"context_line":"        for k, (timeout, timeout_at, gth, exc) in list(self._timeouts.items()):"},{"line_number":5911,"context_line":"            if timeout_at \u003c\u003d now:"},{"line_number":5912,"context_line":"                try:"},{"line_number":5913,"context_line":"                    if k in self._timeouts:"},{"line_number":5914,"context_line":"                        del(self._timeouts[k])"},{"line_number":5915,"context_line":"                except KeyError:"},{"line_number":5916,"context_line":"                    pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_f56304b0","line":5913,"range":{"start_line":5913,"start_character":20,"end_line":5913,"end_character":42},"updated":"2020-03-26 23:01:44.000000000","message":"when would this `if` statement be false?","commit_id":"d889833dbfa474e7783d52cb218955df92132d30"},{"author":{"_account_id":13852,"name":"Romain LE DISEZ","email":"romain.le-disez@corp.ovh.com","username":"rledisez"},"change_message_id":"5b66bfde44df2fed0187d7630698f7ffde0fda68","unresolved":false,"context_lines":[{"line_number":5910,"context_line":"        for k, (timeout, timeout_at, gth, exc) in list(self._timeouts.items()):"},{"line_number":5911,"context_line":"            if timeout_at \u003c\u003d now:"},{"line_number":5912,"context_line":"                try:"},{"line_number":5913,"context_line":"                    if k in self._timeouts:"},{"line_number":5914,"context_line":"                        del(self._timeouts[k])"},{"line_number":5915,"context_line":"                except KeyError:"},{"line_number":5916,"context_line":"                    pass"}],"source_content_type":"text/x-python","patch_set":6,"id":"df33271e_ef8676db","line":5913,"range":{"start_line":5913,"start_character":20,"end_line":5913,"end_character":42},"in_reply_to":"df33271e_f56304b0","updated":"2020-03-27 23:14:54.000000000","message":"I honestly don\u0027t remember. I remember adding it for some case of concurrency. I think it was if, while handling a timeout from the list, we trigger gth.thow, the execution moves to other greenthreads. In this situation, a timeout we will iterate next might ends and gets removed from the list before we reach its loop iteration.","commit_id":"d889833dbfa474e7783d52cb218955df92132d30"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"0f01774e5b5c98ccceedbbec59fe0c3fab2c8198","unresolved":false,"context_lines":[{"line_number":5890,"context_line":"        if not timeout_at:"},{"line_number":5891,"context_line":"            timeout_at \u003d time.time() + timeout"},{"line_number":5892,"context_line":"        gth \u003d eventlet.greenthread.getcurrent()"},{"line_number":5893,"context_line":"        timeout_definition \u003d (timeout, timeout_at, gth, exc)"},{"line_number":5894,"context_line":"        key \u003d id(timeout_definition)"},{"line_number":5895,"context_line":"        self._timeouts[key] \u003d timeout_definition"},{"line_number":5896,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_017b2b8b","line":5893,"updated":"2020-04-03 12:20:28.000000000","message":"so this is why a single watchdog can manage all the timeouts, we pack the gth that scheduled the timeout into the identity key","commit_id":"8378a11d1113386326841ef7065914dd1629a15f"}],"swift/proxy/controllers/obj.py":[{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"1539b45ff6ccf56b4e5a44eefdabefbac62657f2","unresolved":false,"context_lines":[{"line_number":1672,"context_line":"            else:"},{"line_number":1673,"context_line":"                to_send \u003d chunk"},{"line_number":1674,"context_line":"            try:"},{"line_number":1675,"context_line":"                with WatchdogTimeout(self.watchdog, self.write_timeout,"},{"line_number":1676,"context_line":"                                     ChunkWriteTimeout, timeout_at\u003dtimeout_at):"},{"line_number":1677,"context_line":"                    self.conn.send(to_send)"},{"line_number":1678,"context_line":"            except (Exception, ChunkWriteTimeout):"},{"line_number":1679,"context_line":"                self.failed \u003d True"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_78ba62c0","line":1676,"range":{"start_line":1675,"start_character":16,"end_line":1676,"end_character":79},"updated":"2019-12-09 11:06:07.000000000","message":"why are both write_timeout and timeout_at needed here? from quickly looking at start() method it seems that timeout is ignored if `timeout_at !\u003d None`.","commit_id":"1fa9707a81dda2327321b405525646f3f73d63b5"}]}
