Prevent ack timeout from dropping callback ids - #154
Open
EvanDietzMorris wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep callback ids for lookups that time out waiting for the ACK
Problem
I noticed this running helms deep on the dev ARS on Sterling. The dev instance of
Retriever was responding very slowly for some reason and it surfaced this issue.
When submitting an
/asyncqueryto Retriever, bte and aragorn lookup workersuse
httpx.AsyncClient(timeout=20), so submission times over that boundaryraise
ReadTimeout, but it's possible for Retriever to take over 20s to respondto the initial async query without actually failing.
The workers treat every exception during that call as "submission failed" and delete the
callback id. But in these cases, Retriever has the query and is running it and it doesn't know
Shepherd already gave up. When it POSTs the results,
/aragorn/callback/<id>finds no callback id mapping and returns 500. Then the lookup still waits out its full deadline
for results it had already prevented being accepted.
Fix
AsyncResponse.in_flightflag distinguishes "sent but not ACKed" from"never reached the service."
warning instead of calling
remove_callback_id. The lookup's existingdeadline still bounds the wait.
timeout=20(and the non-infer branch'stimeout=100) arereplaced by a new setting,
kg_retrieval_submit_timeout(default 100s).run_async_lookupnow records exceptions on its span, matchingAragorn.
Applied identically to
workers/aragorn_lookupandworkers/bte_lookup.Deployment
KG_RETRIEVAL_SUBMIT_TIMEOUTis a new, defaulted env var but was not added to deployment settings etc.Nothing needs to change in compose or Helm unless a different value is wanted.
Future Considerations
successof an /asyncquery ACK remainsstatus_code == 200, per TRAPI.Technically, Retriever should probably be returning 202 instead of 200.