-
Notifications
You must be signed in to change notification settings - Fork 0
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
Timeout param #427
Timeout param #427
Conversation
strider/knowledge_provider.py
Outdated
@@ -47,6 +48,8 @@ def __init__( | |||
logger=logger, | |||
preproc=self.get_preprocessor(kp["details"]["preferred_prefixes"]), | |||
postproc=self.get_postprocessor(WBMT.entity_prefix_mapping), | |||
max_batch_size=1, |
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.
Have we thoroughly tested how not batching will impact performance?
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.
Good catch. This snuck in cause I have other changes for batch sizing. I've removed it.
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.
Approved, pending comment review in spirit.
strider/server.py
Outdated
lookup(query_dict, qid), timeout=max_process_time | ||
# get max timeout | ||
timeout = max( | ||
max_process_time, query_dict.get("parameters", {}).get("timeout_seconds", 0) |
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 forget the complete details for fastAPI query param parsing. Is it possible for timeout_seconds to end up here as a string or some other non-numeric type.
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 isn't a query param, it's in a dedicated parameters
field in the request body on the same level as message
. And there's no type checking for timeout_seconds
, so someone could pass whatever they wanted. parameters
isn't part of the TRAPI spec, so I highly doubt anyone outside of ranking-agent devs are going to even know that this exists.
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.
Added type checks
Adds a check for
timeout_seconds
inside of requestparameters
sent from Aragorn. This will enable Strider to take longer for kp lookups to provide more thorough answers that get cached in Aragorn.We're also adding a
/clear_cache
endpoint so someone can easily clear the onehop cache.