Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityException: Caller no longer running, last stopped v2 #194

Closed
rykugur opened this issue Apr 13, 2018 · 7 comments
Closed

SecurityException: Caller no longer running, last stopped v2 #194

rykugur opened this issue Apr 13, 2018 · 7 comments

Comments

@rykugur
Copy link

rykugur commented Apr 13, 2018

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)

@thomaszurkan-optimizely
Copy link
Contributor

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.

@thomaszurkan-optimizely
Copy link
Contributor

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!

@thomaszurkan-optimizely
Copy link
Contributor

#193

@thomaszurkan-optimizely
Copy link
Contributor

@rykugur we have released a patch 1.6.1 and a new release 2.0.0 with a potential fix.

@thomaszurkan-optimizely
Copy link
Contributor

@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!

@rykugur
Copy link
Author

rykugur commented Apr 27, 2018 via email

@jia-tse-zocdoc
Copy link

What implications does this bug have? Will the datafile still be refreshed properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants