-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Let's stop using sleep() #1543
Comments
👍 |
I cannot get this behavior to replicate. Not sure how you are forcing the disconnected/waiting to reconnect state, but I can confirm at least this behavior: This indicates to me that it is not in fact the A cursory trace indicated that an unexpected socket state was the more likely culprit. |
Those terminal logs are gone, but I believe the test involved configuring Sopel to connect to a server that would time out or refuse the connection. |
I was randomly looking at things and stumbled upon the remind module. With #1479 and #1557 it should be safer to use the |
No if #1479 gets merged at some point for 7.x. Yes if it isn't. #1479 makes the setup/shutdown cycle better for the job scheduler, combined with a consistent behavior with reload (calling shutdown and removing properly jobs). On the other hand, the current job scheduler is still better than this rogue thread used by |
Quick note here: in the last few months, we decreased the need for
So, even if there are still some occurrence of |
We're down to 4 calls of |
In recent bugfix testing, I discovered that Sopel uses
time.sleep()
in some inconvenient places.For example, pressing Ctrl-C while the bot is waiting to reconnect previously raised an exception, but fixing that bug reveals that Sopel now appears to hang for some number of seconds until the
sleep()
call finishes. Callingsleep()
blocks that entire thread of execution, after all, so no received signals can be processed until the sleep time has elapsed.There are probably other places like that hiding in the code, too, which is why I didn't write this issue specifically about that one case.
I'm hoping we can develop a more responsive way of doing things, maybe using
threading.Event
s. Free admission: I haven't thought about this a lot yet, because I just discovered the issue, and my ideas on how to solve it are probably still way off the mark. 😁Knowing @Exirel's love of refactoring, I'm going to tentatively assign this to him. No milestone because it's not that important, and I don't mind delaying this for a while until there are a lot fewer more-pressing things to do.
The text was updated successfully, but these errors were encountered: