-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix passing command errors from the engine to worker functions #394
Conversation
item = await command_generator.asend(future_results) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't handle errors raised in command_generator.asend()
as they include exceptions thrown in the worker function.
while True: | ||
if self._rescheduled_items: | ||
return True | ||
try: | ||
return await asyncio.wait_for(self.has_new_items(), 1.0) | ||
except asyncio.TimeoutError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of waiting indefinitely on potentialy blocking await self.has_new_items()
, periodically check if there are self._rescheduled_items
.
12a6fc2
to
9cbee0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
am I right that the smartqueue fix only applies to the tasks coming from async generators?
@shadeofblue Yes, in the sense that if you pass a non-async iterator that blocks for a long time before yielding a task to |
Resolves #393
Contains fixes for two separate issues reported by A&C Team:
SmartQueue
(commit 9cbee0f).