{"action":"created","issue":{"url":"https://api.github.com/repos/jurmous/etcd4j/issues/31","labels_url":"https://api.github.com/repos/jurmous/etcd4j/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/jurmous/etcd4j/issues/31/comments","events_url":"https://api.github.com/repos/jurmous/etcd4j/issues/31/events","html_url":"https://github.com/jurmous/etcd4j/issues/31","id":59243316,"number":31,"title":"Default retry handler causes infinite loop","user":{"login":"MartinPodval","id":461527,"avatar_url":"https://avatars.githubusercontent.com/u/461527?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinPodval","html_url":"https://github.com/MartinPodval","followers_url":"https://api.github.com/users/MartinPodval/followers","following_url":"https://api.github.com/users/MartinPodval/following{/other_user}","gists_url":"https://api.github.com/users/MartinPodval/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinPodval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinPodval/subscriptions","organizations_url":"https://api.github.com/users/MartinPodval/orgs","repos_url":"https://api.github.com/users/MartinPodval/repos","events_url":"https://api.github.com/users/MartinPodval/events{/privacy}","received_events_url":"https://api.github.com/users/MartinPodval/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-27T14:34:13Z","updated_at":"2015-03-02T10:28:30Z","closed_at":null,"body":"I use default retry handler RetryWithExponentialBackOff using -1 as maxRetryCount. Unfortunately this specific setting results into infinite loop as method RetryWithExponentialBackOff.shouldRetry returns always true in the case of maxRetryCount=-1 - first condition is always skipped.\r\n\r\nNote that I used following statement to create the policy:\r\n\r\nnew RetryWithExponentialBackOff(20, -1, 1000)"},"comment":{"url":"https://api.github.com/repos/jurmous/etcd4j/issues/comments/76688840","html_url":"https://github.com/jurmous/etcd4j/issues/31#issuecomment-76688840","issue_url":"https://api.github.com/repos/jurmous/etcd4j/issues/31","id":76688840,"user":{"login":"jurmous","id":6823511,"avatar_url":"https://avatars.githubusercontent.com/u/6823511?v=3","gravatar_id":"","url":"https://api.github.com/users/jurmous","html_url":"https://github.com/jurmous","followers_url":"https://api.github.com/users/jurmous/followers","following_url":"https://api.github.com/users/jurmous/following{/other_user}","gists_url":"https://api.github.com/users/jurmous/gists{/gist_id}","starred_url":"https://api.github.com/users/jurmous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurmous/subscriptions","organizations_url":"https://api.github.com/users/jurmous/orgs","repos_url":"https://api.github.com/users/jurmous/repos","events_url":"https://api.github.com/users/jurmous/events{/privacy}","received_events_url":"https://api.github.com/users/jurmous/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T10:28:30Z","updated_at":"2015-03-02T10:28:30Z","body":"It indeed causes an infinite retry loop with the default retry handler. You can change to other retry behaviors. The log will tell what is going on while retrying:\r\n\r\n[nioEventLoopGroup-2-11] DEBUG mousio.client.retry.RetryPolicy - Retry 10 to send command\r\n[nioEventLoopGroup-2-12] DEBUG mousio.etcd4j.transport.EtcdNettyClient - Connection failed to https://127.0.0.1:4001\r\n\r\nWhat do you propose? Use a different default RetryHandler which quits after some time?\r\n\r\n"}}