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

Investigate smarter code timeouting without killing the worker #178

Open
jolampi opened this issue May 7, 2021 · 1 comment
Open

Investigate smarter code timeouting without killing the worker #178

jolampi opened this issue May 7, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jolampi
Copy link
Contributor

jolampi commented May 7, 2021

Blocking infinite loop like

while True:
    pass

prevents the worker from responding to anything. At the moment these situations are handled by killing the whole worker. If these loops could be asyncified (like input() already is) or interrupted by some other means, timeouting could be implemented within the worker itself.

@jolampi jolampi added the enhancement New feature or request label May 7, 2021
@jolampi
Copy link
Contributor Author

jolampi commented Jun 14, 2021

At least while loops could maybe converted from

while condition:
    # infinite loop

to

while (await check_timeout()) && (condition):
    # infinite loop

where check_timeout() is an asynchronous function call to prevent blocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant