learningequality / kolibri-installer-android

Android wrapper for Kolibri.
MIT License
26 stars 22 forks source link

Long running tasks are cancelled after 10 minutes #205

Closed bjester closed 7 months ago

bjester commented 7 months ago

Observed behavior

Long running tasks like a channel resource import are cancelled after 10 minutes.

Errors and logs

Work [ id=31c6913f-9e0b-498c-8a51-b8eb6bec827a, tags={ kolibri_job_type:kolibri.core.content.tasks.remotecontentimport, kolibri_job_long_running, kolibri_task_id:af5648f9761d492fa8c12b282acfcf58, org.learningequality.Kolibri.ForegroundWorker } ] was cancelled
java.util.concurrent.CancellationException: Task was cancelled.
  at androidx.work.impl.utils.futures.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:1183)
  at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:513)
  at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:474)
  at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:316)
  at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
  at java.lang.Thread.run(Thread.java:923)

Expected behavior

Our long-running tasks should be run in a foreground service, which bypasses the 10 minute limitation and the tasks are not cancelled after 10 minutes.

User-facing consequences

Large channel imports get interrupted and even if they start over, which is still slow, can make it nearly impossible to complete a full import of a channel.

Steps to reproduce

Import a large channel that can take over 10 minutes to fully import.

Context

Kolibri 0.16.0 Kolibri for Android 0.1.0 Android 11