-
Notifications
You must be signed in to change notification settings - Fork 25
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
stopcronjobs() hangs the server (on macOS) #135
Comments
Hi @doorisajar, Thanks for bringing up this issue. I never exported the |
Hi @doorisajar, thanks for the example script, this was very helpful in debugging this issue. Try installing a build from this branch which should address this issue: https://github.com/ndortega/Oxygen.jl/tree/bugfix/cron-job-restarting-issue This issue stemmed from the way I was terminating running tasks which caused the server to close which looked like it was "hanging". With these changes, I'm using an internal global reference which is checked every second within each task to see if each task should continue or stop. It's worth mentioning that stopping cron jobs now completely clears any internal references to stored jobs and requires re-registering to run them again (like in your example). |
This does fix the issue, thank you! |
Hi @doorisajar, Sorry to mess with a working solution, but I've made a couple of additional changes around this.
Checkout my demo script here to see an example of this in action: Let me know what you think! |
^^ This update works perfectly. I have a good use for Thanks! |
I've been trying to use the cron management functionality, but every time I try to stop cron jobs in order to replace them with new ones, my server hangs. A small example:
After starting the server, everything runs as expected until
stopcronjobs()
is called (either directly or insideterminate()
) while there are already registered cron jobs.For example, I can run the server, hit the
/stop
endpoint, and see it shut down gracefully. Or I can run the server, hit the/start
endpoint, and see the cron job start running every 10 seconds. But if I hit/start
a second time, or hit/stop
once the cron job is registered, the server hangs.I've tested this directly on macOS 14.1.1 with Julia 1.9.3 and Oyxgen.jl 1.2.0, as well as indirectly in a Ubuntu 20.04 deployment environment that I don't have direct control over. I could do more direct testing on Linux, but I'm far from an expert.
The text was updated successfully, but these errors were encountered: