-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: improve async sharding #977
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
@@ -755,6 +755,10 @@ async def read_rows_with_semaphore(query): | |||
async with concurrency_sem: | |||
# calculate new timeout based on time left in overall operation | |||
shard_timeout = next(rpc_timeout_generator) | |||
if shard_timeout <= 0: | |||
raise DeadlineExceeded( | |||
"Operation timeout exceeded before starting query" |
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.
maybe before starting subquery?
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.
This is the earliest we can check after getting through the semaphore.
There is a similar check at the very beginning as part of _get_timeouts
though (which raises an AttributeError
)
Use a semaphore to control shard concurrency, rather than discrete batches