)]}'
{"tooz/drivers/redis.py":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"3dcb69e0aaf306d33de47f8e24038d8f553f7ba2","unresolved":true,"context_lines":[{"line_number":102,"context_line":"    def heartbeat(self):"},{"line_number":103,"context_line":"        with self._exclusive_access:"},{"line_number":104,"context_line":"            if self.acquired:"},{"line_number":105,"context_line":"                with _translate_failures():"},{"line_number":106,"context_line":"                    self._lock.reacquire()"},{"line_number":107,"context_line":"                    return True"},{"line_number":108,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7f75d0_0bd3e9b2","side":"PARENT","line":105,"range":{"start_line":105,"start_character":21,"end_line":105,"end_character":40},"updated":"2021-03-10 09:20:02.000000000","message":"Don\u0027t we want to handle retry there too?","commit_id":"fa2b6cc7aecd71677ba6c244abc6954aae48cd2a"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"3dcb69e0aaf306d33de47f8e24038d8f553f7ba2","unresolved":true,"context_lines":[{"line_number":515,"context_line":"        try:"},{"line_number":516,"context_line":"            beat_id \u003d self._encode_beat_id(self._member_id)"},{"line_number":517,"context_line":"            expiry_ms \u003d max(0, int(self.membership_timeout * 1000.0))"},{"line_number":518,"context_line":"            self._client.psetex(beat_id, time_ms\u003dexpiry_ms,"},{"line_number":519,"context_line":"                                value\u003dself.STILL_ALIVE)"},{"line_number":520,"context_line":"        except exceptions.RedisError as e:"},{"line_number":521,"context_line":"            utils.raise_with_cause(tooz.ToozError,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf825df9_5f2aca8e","line":518,"updated":"2021-03-10 09:20:02.000000000","message":"Does the connection will be automatically restablished by the client at this point?\n\nIf the connection isn\u0027t automatically restored I\u0027m not sure to see how this retry will help to solve this issue.\n\nDon\u0027t we need to reset the connection by reinitializing the client if we face a connection or a timeout error?\n\nThe goal of an heartbeat is to keep connections actives if I correctly understand your issue at this point we already loose the connection, isn\u0027t?\n\nEither this method is wrongly named or we don\u0027t do the right thing.","commit_id":"3cc35b034c70202c99f0a4642ce9189f652ba694"},{"author":{"_account_id":4264,"name":"Matthias Runge","email":"mrunge@redhat.com","username":"mrunge"},"change_message_id":"8368b2bed5255c6259b716c2b313f3b4bcb0504b","unresolved":true,"context_lines":[{"line_number":515,"context_line":"        try:"},{"line_number":516,"context_line":"            beat_id \u003d self._encode_beat_id(self._member_id)"},{"line_number":517,"context_line":"            expiry_ms \u003d max(0, int(self.membership_timeout * 1000.0))"},{"line_number":518,"context_line":"            self._client.psetex(beat_id, time_ms\u003dexpiry_ms,"},{"line_number":519,"context_line":"                                value\u003dself.STILL_ALIVE)"},{"line_number":520,"context_line":"        except exceptions.RedisError as e:"},{"line_number":521,"context_line":"            utils.raise_with_cause(tooz.ToozError,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bb865462_5fbd1ce4","line":518,"in_reply_to":"bf825df9_5f2aca8e","updated":"2021-03-10 10:08:57.000000000","message":"The connection is re-established by the client. I couldn\u0027t find the root cause why redis keeps closing the connection from time to time (when used via haproxy), that is a change between ... let\u0027s say queens and train.. \n\nThe heartbeat feature in redis-py does not solve this issue (preventing redis server closing it down).","commit_id":"3cc35b034c70202c99f0a4642ce9189f652ba694"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"3dcb69e0aaf306d33de47f8e24038d8f553f7ba2","unresolved":true,"context_lines":[{"line_number":519,"context_line":"                                value\u003dself.STILL_ALIVE)"},{"line_number":520,"context_line":"        except exceptions.RedisError as e:"},{"line_number":521,"context_line":"            utils.raise_with_cause(tooz.ToozError,"},{"line_number":522,"context_line":"                                   encodeutils.exception_to_unicode(e),"},{"line_number":523,"context_line":"                                   cause\u003de)"},{"line_number":524,"context_line":"        except exceptions.TimeoutError as e:"},{"line_number":525,"context_line":"            utils.raise_with_cause(coordination.ToozConnectionError,"}],"source_content_type":"text/x-python","patch_set":2,"id":"29ae4aeb_4508ddfa","line":522,"updated":"2021-03-10 09:20:02.000000000","message":"Can\u0027t we continue with `_translate_failure` and simply catch `coordination.ToozConnectionError`\nand `exceptions.RedisError`?\n\nIn this case our tenacity retry exception type caught will be against `coordination.ToozConnectionError`.\n\nThat will allow us to keep uniformity with other methods based on `_translate_failure` and will avoid the related technical debt.","commit_id":"3cc35b034c70202c99f0a4642ce9189f652ba694"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"3dcb69e0aaf306d33de47f8e24038d8f553f7ba2","unresolved":true,"context_lines":[{"line_number":521,"context_line":"            utils.raise_with_cause(tooz.ToozError,"},{"line_number":522,"context_line":"                                   encodeutils.exception_to_unicode(e),"},{"line_number":523,"context_line":"                                   cause\u003de)"},{"line_number":524,"context_line":"        except exceptions.TimeoutError as e:"},{"line_number":525,"context_line":"            utils.raise_with_cause(coordination.ToozConnectionError,"},{"line_number":526,"context_line":"                                   encodeutils.exception_to_unicode(e),"},{"line_number":527,"context_line":"                                   cause\u003de)"}],"source_content_type":"text/x-python","patch_set":2,"id":"26fbabd4_9edabc11","line":524,"range":{"start_line":524,"start_character":26,"end_line":524,"end_character":38},"updated":"2021-03-10 09:20:02.000000000","message":"If I understand correctly our code you ignored the ConnectionError to allow tenacity to catch it and then here you only handle timeouts to override `_translate_failure`, isn\u0027t?\n\nWhy we don\u0027t want to retry on timeout too?\n\nShouldn\u0027t we try to retry under timeout condition too?\n\nTooz consider timeouts and connection errors as one and same thing (ToozConnectionError) so I think our retry strategy should do the same thing too.","commit_id":"3cc35b034c70202c99f0a4642ce9189f652ba694"},{"author":{"_account_id":4264,"name":"Matthias Runge","email":"mrunge@redhat.com","username":"mrunge"},"change_message_id":"8368b2bed5255c6259b716c2b313f3b4bcb0504b","unresolved":true,"context_lines":[{"line_number":521,"context_line":"            utils.raise_with_cause(tooz.ToozError,"},{"line_number":522,"context_line":"                                   encodeutils.exception_to_unicode(e),"},{"line_number":523,"context_line":"                                   cause\u003de)"},{"line_number":524,"context_line":"        except exceptions.TimeoutError as e:"},{"line_number":525,"context_line":"            utils.raise_with_cause(coordination.ToozConnectionError,"},{"line_number":526,"context_line":"                                   encodeutils.exception_to_unicode(e),"},{"line_number":527,"context_line":"                                   cause\u003de)"}],"source_content_type":"text/x-python","patch_set":2,"id":"c17c221a_0fd41a8e","line":524,"range":{"start_line":524,"start_character":26,"end_line":524,"end_character":38},"in_reply_to":"26fbabd4_9edabc11","updated":"2021-03-10 10:08:57.000000000","message":"I see ConnectionErrors happening all over, but most interestingly, the stack trace only happens here in this heartbeat function.\nAlso, I didn\u0027t want to change any functionality other than retrying on ConnectionError, which is the error thrown, when the server closes down the connection.","commit_id":"3cc35b034c70202c99f0a4642ce9189f652ba694"}]}
