-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
acquire/release token on TaskWorker without errors #14084
Conversation
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.
Can you add a test for this? Submitting the same task run twice via execute_task_run
should give us the confidence we need.
Added! Let me know if its not what you had in mind |
async with task_worker: | ||
await asyncio.gather( | ||
task_worker.execute_task_run(task_run), | ||
task_worker.execute_task_run(task_run), |
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.
On main
this errors with this borrower is already holding one of this CapacityLimiter's tokens
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!
When acquiring or releasing a token we need to be sure to not propagate
RuntimeError
s so that theTaskWorker
keeps running.