learningequality / kolibri-installer-android

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

Logging for end of task can get repeated #156

Closed rtibbles closed 1 year ago

rtibbles commented 1 year ago

Observed behavior

Some Kolibri tasks deliberately use a fixed id or computed id to allow a job to have a 'get or create' behaviour. On Android, it seems that the queueing mechanism is failing to capture this and is queueing excess jobs in WorkManager.

Expected behavior

Jobs enqueued by work manager should be unique!

User-facing consequences

Unnecessarily repeated tasks - possible contention for resources.

Steps to reproduce

Schedule a job with the same id as an already enqueued job.

rtibbles commented 1 year ago

It seems like this may not actually be the case, and may just be a logging issue where root log statements made after Kolibri has been initialized can get double logged:

INFO 2023-08-25 10:09:37,636 root Ending Kolibri task worker, for job 2c8cedaf36cfdf26328a4dee8d53d6dc
INFO 2023-08-25 10:09:37,701 root Starting Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:37,758 kolibri.core.discovery.utils.network.client Attempting connections to variations of the URL: http://192.168.0.139:8080/
INFO 2023-08-25 10:09:37,797 kolibri.core.discovery.utils.network.client Attempting connection to: http://192.168.0.139:8080/
INFO 2023-08-25 10:09:37,964 kolibri.core.discovery.utils.network.client Success! We connected to: http://192.168.0.139:8080/api/public/info/?v=3
INFO 2023-08-25 10:09:38,007 root Ending Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:38,626 root Ending Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:38,733 root Starting Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:38,821 kolibri.core.discovery.utils.network.client Attempting connection to: http://192.168.0.139:8080/
INFO 2023-08-25 10:09:38,873 kolibri.core.discovery.utils.network.client Success! We connected to: http://192.168.0.139:8080/api/public/info/?v=3
INFO 2023-08-25 10:09:38,906 root Ending Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:39,760 root Ending Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:39,890 root Starting Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37
INFO 2023-08-25 10:09:39,996 kolibri.core.discovery.utils.network.client Attempting connection to: http://192.168.0.139:8080/
INFO 2023-08-25 10:09:40,038 kolibri.core.discovery.utils.network.client Success! We connected to: http://192.168.0.139:8080/api/public/info/?v=3
INFO 2023-08-25 10:09:40,075 root Ending Kolibri task worker, for job ef6228c97d8a39b61043499bd501bd37