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 hangs indefinitely when scheduling a new job #276

Closed
xalexalex opened this issue Aug 4, 2019 · 1 comment · Fixed by #277
Closed

termux-job-scheduler hangs indefinitely when scheduling a new job #276

xalexalex opened this issue Aug 4, 2019 · 1 comment · Fixed by #277

Comments

@xalexalex
Copy link
Collaborator

Problem description
termux-job-scheduler is unable to schedule a job, and hangs when I try to.

Steps to reproduce

cat > ~/script <<EOF
#!/data/data/com.termux/files/usr/bin/bash
termux-notification --content "$(date)"
EOF
chmod +x ~/script
termux-job-scheduler --script ~/script --period-ms 1800000

Expected behavior
script is scheduled to run every 30m ± 5m and termux-job-scheduler exits.

Actual behavior
the script runs once, but termux-job-scheduler hangs. termux-job-scheduler --pending run in another session doesn't output anything.

Additional information
termux-info:

Updatable packages:
All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://dl.bintray.com/termux/termux-packages-24 stable/main
System information:
Linux localhost 4.4.23+ #1 SMP PREEMPT Tue Jun 12 17:03:20 CST 2018 aarch64 Android
Termux-packages arch:
aarch64
Android version:
9
Device manufacturer:
HUAWEI
Device model:
PRA-LX1

Log: log-adb.txt

@xalexalex
Copy link
Collaborator Author

On further examination, apparently the hang is due to the lack of an explicit --network option, because despite termux-job-scheduler -h saying that the default for --network is "none", JobSchedulerApi.java does not handle the case where networkType == null.

I submitted a PR which adds handling for this case, with a default of "any" (which I think is more sensible than the default "none", however feel free to change that).

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

Successfully merging a pull request may close this issue.

1 participant