-
Notifications
You must be signed in to change notification settings - Fork 138
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 grpc upload retry timeout #841
Conversation
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
a147de6
to
25d452d
Compare
new: Add timeouts to delete and upsert
new: Added missing timeouts
2dfe1a4
to
bc85c04
Compare
qdrant_client/connection.py
Outdated
@@ -200,9 +201,23 @@ async def intercept_call( | |||
|
|||
|
|||
def parse_channel_options(options: Optional[Dict[str, Any]] = None) -> List[Tuple[str, Any]]: | |||
timeout = f'{str(options.copy().pop("timeout", "10"))}s' if options else "10s" |
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.
do we need to extract timeout
from options anywhere else?
@@ -2912,6 +2916,7 @@ def _upload_collection( | |||
"metadata": self._grpc_headers, | |||
"wait": wait, | |||
"shard_key_selector": shard_key_selector, | |||
"options": self._grpc_options, |
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.
i think it's enough to pass just timeout rather than the whole options
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.
I was wrong, it's actually a bug, we've been needing to pass it all the time
qdrant_client/connection.py
Outdated
( | ||
"grpc.service_config", | ||
json.dumps( | ||
{ | ||
"methodConfig": [ | ||
{ | ||
"name": [{}], | ||
"timeout": timeout, | ||
}, | ||
] | ||
} | ||
), | ||
), |
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.
it feels to be too much for this, we already have timeouts in all the methods
- it is a little bit ugly because we need to create a json string
- if anyone is providing or will provide
grpc.service_config
viagrpc_options
it will break things - it does not work as you assume when you look at it, I've done several experiments and it has never waited for
timeout
, but fortimeout - 1s
ortimeout - 2s
. Thus, if we set timeout=1 it just raises an Exception immediately
I would rather add GRPC_DEFAULT_TIMEOUT
or something like that to QdrantRemote
* improve: Added a default timeout in grpc if the connection is dead * improve: Added 5 seconds wait before retry * fix: Fix grpc timeout * nit * fix: Fix bug in timeouts new: Add timeouts to delete and upsert * new: Propagate timeout to grpc default options new: Added missing timeouts * nit * refactor: Changed how we define the default grpc timeout * remove redundant import * fix: add missing timeouts * fix: Added missing timeout in rest * fix: Added async --------- Co-authored-by: George <george.panchuk@qdrant.tech>
Rest has a default timeout (mostly managed by the network stack of the OS if the requests library default to none), but grpc doesn't have a default one. I've added a default value in the channel options.
There's also no default waiting mechanism for waiting before retrying.
All Submissions:
dev
branch. Did you create your branch fromdev
?New Feature Submissions:
pre-commit
withpip3 install pre-commit
and set up hooks withpre-commit install
?Changes to Core Features: