{"action":"opened","issue":{"url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/279","repository_url":"https://api.github.com/repos/yigit/android-priority-jobqueue","labels_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/279/comments","events_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/279/events","html_url":"https://github.com/yigit/android-priority-jobqueue/issues/279","id":188528103,"number":279,"title":"Inifinite Retry","user":{"login":"jemshit","id":1948828,"avatar_url":"https://avatars.githubusercontent.com/u/1948828?v=3","gravatar_id":"","url":"https://api.github.com/users/jemshit","html_url":"https://github.com/jemshit","followers_url":"https://api.github.com/users/jemshit/followers","following_url":"https://api.github.com/users/jemshit/following{/other_user}","gists_url":"https://api.github.com/users/jemshit/gists{/gist_id}","starred_url":"https://api.github.com/users/jemshit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jemshit/subscriptions","organizations_url":"https://api.github.com/users/jemshit/orgs","repos_url":"https://api.github.com/users/jemshit/repos","events_url":"https://api.github.com/users/jemshit/events{/privacy}","received_events_url":"https://api.github.com/users/jemshit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-10T14:51:57Z","updated_at":"2016-11-10T14:51:57Z","closed_at":null,"body":"I have this Initialization, Singleton:\r\n```java\r\n    @Provides\r\n    @Singleton\r\n    public JobManager provideJobManager() {\r\n        JobManager jobManager;\r\n        JobManagerLogger jobManagerLogger = new JobManagerLogger();\r\n        JobCallback jobManagerCallback = new JobCallback();\r\n\r\n        Configuration config = new Configuration.Builder(app)\r\n                .minConsumerCount(1)\r\n                .maxConsumerCount(3)\r\n                .injector(new DependencyInjector() {\r\n                    @Override\r\n                    public void inject(Job job) {\r\n                        if (job instanceof BaseJob) {\r\n                            ((BaseJob) job).inject(app.getAppComponent());\r\n                        }\r\n                    }\r\n                })\r\n                .consumerKeepAlive(45)\r\n                .build();\r\n        jobManager=new JobManager(config);\r\n        jobManager.addCallback(jobManagerCallback);\r\n\r\n        return jobManager;\r\n    }\r\n```\r\nI inject it in `Application` class:\r\n```java\r\n@Inject\r\nJobManager jobManager;\r\n```\r\nAlso inject it in imageDownload class.\r\n\r\nI have this retry logic:\r\n```java\r\n@Override\r\n    protected RetryConstraint shouldReRunOnThrowable(Throwable throwable, int runCount, int maxRunCount) {       \r\n        if (throwable!=null && shouldRetry(throwable)) {\r\n            // Just back off 5000 ms.\r\n            RetryConstraint constraint = RetryConstraint\r\n                    .createExponentialBackoff(runCount, 5000);\r\n            constraint.setApplyNewDelayToGroup(false);\r\n            return constraint;\r\n        }else if(throwable==null){\r\n            return RetryConstraint.RETRY;\r\n        }\r\n        return RetryConstraint.CANCEL;\r\n    }\r\n```\r\n \r\nLogcat:\r\n```java\r\nJobManager: error while executing job com.pordiva.skylife.background_job.ImageDownloadJob@c26b8ea\r\n                                                                       java.net.SocketTimeoutException\r\n                                                                           at java.net.PlainSocketImpl.read(PlainSocketImpl.java:484)\r\n                                                                           at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)\r\n                                                                           at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)\r\n                                                                           at okio.Okio$2.read(Okio.java:138)\r\n                                                                           at okio.AsyncTimeout$2.read(AsyncTimeout.java:238)\r\n                                                                           at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)\r\n                                                                           at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)\r\n                                                                           at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)\r\n                                                                           at okhttp3.internal.http.Http1xStream.readResponse(Http1xStream.java:186)\r\n                                                                           at okhttp3.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:127)\r\n                                                                           at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:53)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n                                                                           at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n                                                                           at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n                                                                           at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n                                                                           at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)\r\n                                                                           at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)\r\n                                                                           at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)\r\n                                                                           at okhttp3.RealCall.execute(RealCall.java:60)\r\n                                                                           at com.pordiva.skylife.background_job.ImageDownloadJob$override.onRun(ImageDownloadJob.java:97)\r\n                                                                           at com.pordiva.skylife.background_job.ImageDownloadJob$override.access$dispatch(ImageDownloadJob.java)\r\n                                                                           at com.pordiva.skylife.background_job.ImageDownloadJob.onRun(ImageDownloadJob.java:0)\r\n                                                                           at com.birbit.android.jobqueue.Job.safeRun(Job.java:229)\r\n                                                                           at com.birbit.android.jobqueue.JobHolder.safeRun(JobHolder.java:132)\r\n                                                                           at com.birbit.android.jobqueue.ConsumerManager$Consumer.handleRunJob(ConsumerManager.java:407)\r\n                                                                           at com.birbit.android.jobqueue.ConsumerManager$Consumer.access$000(ConsumerManager.java:326)\r\n                                                                           at com.birbit.android.jobqueue.ConsumerManager$Consumer$2.handleMessage(ConsumerManager.java:354)\r\n                                                                           at com.birbit.android.jobqueue.messaging.SafeMessageQueue.consume(SafeMessageQueue.java:36)\r\n                                                                           at com.birbit.android.jobqueue.ConsumerManager$Consumer.run(ConsumerManager.java:389)\r\n                                                                           at java.lang.Thread.run(Thread.java:818)\r\n11-10 17:47:02.532 23153-23401/com.pordiva.skylife.debug D/MyCustomLog JobCallback: -------------------------------\r\n                                                                                    onAfterJobRun\r\n                                                                                    \t\t\t | resultCode: RESULT_FAIL_WILL_RETRY\r\n```\r\n\r\ni once saw `RESULT_CANCEL_REACHED_RETRY_LIMIT` after 10 minutes... Is there any problem with my retry logic? How many times it retry ?"}}
{"actor":{"display_login":"jemshit"}}