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

termux-job-scheduler random scheduling on some devices #742

Open
43qcc2cn opened this issue Jan 17, 2025 · 0 comments
Open

termux-job-scheduler random scheduling on some devices #742

43qcc2cn opened this issue Jan 17, 2025 · 0 comments

Comments

@43qcc2cn
Copy link

Problem description

I have the same set up on a number of different Samsung devices. A scheduled job that runs a bash script (test.sh) which simply writes the result of the "date" command to a file.

The results of using the termux-job-scheduler tool seem to fall into one of two camps across these devices. Either the scheduling is consistent or it is completely random.

The scheduled job is as follows:

Pending Job 0: /data/data/com.termux/files/home/bin/test.sh (periodic: 3600000ms) (persisted) (battery not low) (network: NetworkRequest [ NONE id=0, [ Capabilities: INTERNET&TRUSTED&VALIDATED&NOT_VCN_MANAGED&NOT_BANDWIDTH_CONSTRAINED Uid: 10229 UnderlyingNetworks: Null] ])

Below is the output from an example device (SM-G973F) where the results are consistent:

Thu Jan 16 00:03:25 GMT 2025
Thu Jan 16 01:06:26 GMT 2025
Thu Jan 16 02:06:32 GMT 2025
Thu Jan 16 03:04:38 GMT 2025
Thu Jan 16 04:00:39 GMT 2025
Thu Jan 16 05:03:40 GMT 2025
Thu Jan 16 06:06:32 GMT 2025
Thu Jan 16 07:01:47 GMT 2025
Thu Jan 16 08:01:32 GMT 2025
Thu Jan 16 09:00:18 GMT 2025
Thu Jan 16 10:06:34 GMT 2025
Thu Jan 16 11:03:44 GMT 2025
Thu Jan 16 12:06:38 GMT 2025
Thu Jan 16 13:06:38 GMT 2025
Thu Jan 16 14:06:38 GMT 2025
Thu Jan 16 15:06:38 GMT 2025
Thu Jan 16 16:06:38 GMT 2025
Thu Jan 16 17:06:39 GMT 2025
Thu Jan 16 18:06:38 GMT 2025
Thu Jan 16 19:03:48 GMT 2025
Thu Jan 16 20:03:45 GMT 2025
Thu Jan 16 21:02:37 GMT 2025
Thu Jan 16 22:01:16 GMT 2025
Thu Jan 16 23:01:40 GMT 2025
Fri Jan 17 00:01:17 GMT 2025
Fri Jan 17 01:04:18 GMT 2025
Fri Jan 17 02:00:19 GMT 2025
Fri Jan 17 03:03:20 GMT 2025
Fri Jan 17 04:01:23 GMT 2025
Fri Jan 17 05:01:25 GMT 2025
Fri Jan 17 06:01:28 GMT 2025
Fri Jan 17 07:01:19 GMT 2025
Fri Jan 17 08:01:35 GMT 2025
Fri Jan 17 09:00:30 GMT 2025
Fri Jan 17 10:00:37 GMT 2025
Fri Jan 17 11:01:58 GMT 2025
Fri Jan 17 12:01:38 GMT 2025
Fri Jan 17 13:02:47 GMT 2025

Below is the output from an example device (SM-T725) where the results are completely random:

Thu Jan 16 00:09:33 GMT 2025
Thu Jan 16 00:09:36 GMT 2025
Thu Jan 16 04:10:03 GMT 2025
Thu Jan 16 07:04:08 GMT 2025
Thu Jan 16 10:10:35 GMT 2025
Thu Jan 16 10:10:38 GMT 2025
Thu Jan 16 14:33:30 GMT 2025
Thu Jan 16 14:33:32 GMT 2025
Thu Jan 16 19:01:18 GMT 2025
Thu Jan 16 20:01:23 GMT 2025
Thu Jan 16 21:20:06 GMT 2025
Thu Jan 16 22:01:38 GMT 2025
Thu Jan 16 23:41:18 GMT 2025
Fri Jan 17 01:41:49 GMT 2025
Fri Jan 17 01:41:52 GMT 2025
Fri Jan 17 05:42:19 GMT 2025
Fri Jan 17 05:42:22 GMT 2025
Fri Jan 17 12:15:06 GMT 2025
Fri Jan 17 12:15:10 GMT 2025
Fri Jan 17 13:23:37 GMT 2025

On all devices, Battery Saver is off and both Termux and Termux API have their app battery usage set to "Unrestricted".

Could this be a problem with either Termux or the Termux API, or is it simply the results of an underlying problem with the OS?

I've had a look in the LineageOS and Android issue trackers but can't see anything obvious to me.

Steps to reproduce

Schedule a job to run every hour which writes the date to a log file (see above).

Expected behavior

The job should run consistently every hour (more or less).

Additional information

  • termux application version: 0.118.1 (F-Droid)
  • termux-api application version: 0.50.1 (F-Droid)
  • termux-api package version (installed through apt): 0.58.0-1
  • Android OS version: 15 (LineageOS 22.1)
  • Device model: Various Samsung phones and tablets (see above)

Happy to supply any additional information, or perform additional testing, as required.

Any help or advice is appreciated.

Thanks in advance.

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

1 participant