{"action":"created","issue":{"url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/274","repository_url":"https://api.github.com/repos/Grokzen/redis-py-cluster","labels_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/274/comments","events_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/274/events","html_url":"https://github.com/Grokzen/redis-py-cluster/issues/274","id":356378061,"node_id":"MDU6SXNzdWUzNTYzNzgwNjE=","number":274,"title":"Fails to auto-reconnect when master goes down","user":{"login":"15astro","id":17779264,"node_id":"MDQ6VXNlcjE3Nzc5MjY0","avatar_url":"https://avatars3.githubusercontent.com/u/17779264?v=4","gravatar_id":"","url":"https://api.github.com/users/15astro","html_url":"https://github.com/15astro","followers_url":"https://api.github.com/users/15astro/followers","following_url":"https://api.github.com/users/15astro/following{/other_user}","gists_url":"https://api.github.com/users/15astro/gists{/gist_id}","starred_url":"https://api.github.com/users/15astro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/15astro/subscriptions","organizations_url":"https://api.github.com/users/15astro/orgs","repos_url":"https://api.github.com/users/15astro/repos","events_url":"https://api.github.com/users/15astro/events{/privacy}","received_events_url":"https://api.github.com/users/15astro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-03T06:50:14Z","updated_at":"2018-09-03T13:53:44Z","closed_at":null,"author_association":"NONE","body":"When following code is executed on the cluster with nodes( 3 masters and 3 slaves) and one of the master goes down, the code breaks and does not reconnect:\r\nRedis version: 4.0.11\r\nredis-py-cluster: 1.3.5\r\n```\r\nfrom rediscluster import StrictRedisCluster as rc\r\nr = rc(startup_nodes=[{\"host\": \"10..0.0.1\", \"port\": \"7000\"},{\"host\": \"10.0.0.2\", \"port\": \"9000\"},{\"host\": \"10.0.0.3\", \"port\": \"9000\"}])\r\nfor i in range(1,1000000):\r\n  r.set(\"b\", i)\r\n\r\n```\r\nCase 1: CLUSTER FAILOVER\r\n\r\nWhen the cluster failover is executed on the slave of the first node, the above code automatically reconnects to the new master and keep writing data\r\n\r\nCase 2: Kill master\r\nWhen the 1 master is killed, the script brreaks with following error:\r\n```\r\nFile \"python-batch.py\", line 7, in <module>\r\n    r.set(\"b\"+`i`, i)\r\n  File \"/usr/lib/python2.7/site-packages/redis/client.py\", line 1171, in set\r\n    return self.execute_command('SET', *pieces)\r\n  File \"/usr/lib/python2.7/site-packages/rediscluster/utils.py\", line 101, in inner\r\n    return func(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/site-packages/rediscluster/client.py\", line 403, in execute_command\r\n    raise ClusterError('TTL exhausted.')\r\nrediscluster.exceptions.ClusterError: TTL exhausted.\r\n```\r\nIs there any additional config params required or how this can be handeled without breaking the script which is performing writes? @Grokzen "},"comment":{"url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/comments/418122243","html_url":"https://github.com/Grokzen/redis-py-cluster/issues/274#issuecomment-418122243","issue_url":"https://api.github.com/repos/Grokzen/redis-py-cluster/issues/274","id":418122243,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODEyMjI0Mw==","user":{"login":"15astro","id":17779264,"node_id":"MDQ6VXNlcjE3Nzc5MjY0","avatar_url":"https://avatars3.githubusercontent.com/u/17779264?v=4","gravatar_id":"","url":"https://api.github.com/users/15astro","html_url":"https://github.com/15astro","followers_url":"https://api.github.com/users/15astro/followers","following_url":"https://api.github.com/users/15astro/following{/other_user}","gists_url":"https://api.github.com/users/15astro/gists{/gist_id}","starred_url":"https://api.github.com/users/15astro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/15astro/subscriptions","organizations_url":"https://api.github.com/users/15astro/orgs","repos_url":"https://api.github.com/users/15astro/repos","events_url":"https://api.github.com/users/15astro/events{/privacy}","received_events_url":"https://api.github.com/users/15astro/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T13:53:44Z","updated_at":"2018-09-03T13:53:44Z","author_association":"NONE","body":"The new master is elected within a second and all nodes are in connected states including startup_nodes"}}
{"actor":{"display_login":"15astro"}}