-
Notifications
You must be signed in to change notification settings - Fork 16
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
ServiceThread complains Task was destroyed but it is pending! #38
Comments
I believe the issue here is that the thread loop is not properly shutdown. If you look at asyncio.run there are several steps to properly closing a loop. Unfortunately, the shutdown steps are not available in a convenient standalone method. It's a bit more re-usable in 3.11 though. Another option would be to ensure |
Give #39 a look, should fix the issue you see. |
…_thread` (#39) * fix import logic again to address #38 * fix thread test import Event * fix thread test import Event * commit potential fix? * replace asyncio.sleep with self.sleep * readd get_event_loop_policy() * readd loop kwargs until we figure out what to do * fix server test import * fix erroneous loops because im illiterate * Add changes by @lqhuang
Checklist
master
branch of Mode.Steps to reproduce
I have a scheduled job that start and stop a ServiceThread but it complains "Task was destroyed but it is pending!"
The following script simulates the scheduled job.
Expected behavior
The script should only print "hello"
Actual behavior
It complains "Task was destroyed but it is pending!"
Full traceback
Versions
The text was updated successfully, but these errors were encountered: