SecurityException: Caller no longer running, last stopped v2
rykugur opened this issue · 7 comments
This is a continuation of this issue: #166
We're seeing the same crash and stacktrace after implementing the intent filter in code.
Stacktrace:
Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by java.lang.SecurityException: Caller no longer running, last stopped +6s841ms because: timed out while starting
at android.os.Parcel.readException(Parcel.java:1958)
at android.os.Parcel.readException(Parcel.java:1904)
at android.app.job.IJobCallback$Stub$Proxy.dequeueWork(IJobCallback.java:191)
at android.app.job.JobParameters.dequeueWork(JobParameters.java:196)
at com.optimizely.ab.android.shared.JobWorkService$CommandProcessor.doInBackground(JobWorkService.java:73)
at com.optimizely.ab.android.shared.JobWorkService$CommandProcessor.doInBackground(JobWorkService.java:56)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Snippet of our intent-filter in our Application.onCreate()
method:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
EventRescheduler rescheduler = new EventRescheduler();
registerReceiver(rescheduler, new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION));
}
99% of our crashes are happening on Android O, with a large number of those users on Samsung devices (but this doesn't seem to be a Samsung-only issue, there are also a fair number of HTC, LG, Google, etc. devices)
Apparently, this is a known issue:
https://issuetracker.google.com/issues/63622293
I see a lot of github issues in other repos on this as well. I think the catching of the exception and exiting will solve the problem.
This is pertaining to this issue:
https://issuetracker.google.com/issues/63622293
The service was probably destroyed but we didn't cancel the
processor. It causes an exception in dequeueWork.
We wrapped the dequeueWork with a try/catch and are also now calling cancel in onDestroy.
Thanks for reporting this!
@rykugur we have released a patch 1.6.1 and a new release 2.0.0 with a potential fix.
@rykugur I'm closing this since it was addressed in patch 1.6.1 and release 2.0.0. Feel free to open this back up if you continue to see this issue after updating to 1.6.1 or 2.0.0. Thanks!
What implications does this bug have? Will the datafile still be refreshed properly?