fix(agent): set context deadline for grpc model server control plane #5329
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.
What this PR does / why we need it:
Previously we have a
Background
context used in the control plane operations (load/unload) issued from the agent to the model servers (mlserver and triton). The background context will wait indefinitely if the model servers do not respond back and we have seen cases (on unload) that mlserver did not respond back to the unload (not sure why).Anyway in the case that mlserver did not respond back the agent will be stuck indefinitely on this particular model and therefore the scheduler state of this model is also stuck.
To get around that we use a
Deadline
context now on these control plane operations as follows:GRPCModelServerLoadTimeout
= 30 MinutesGRPCModelServerUnloadTimeout
= 2 MinutesGRPCControlPlaneTimeout
= 1 Minutes (for other control plane ops)We currently use the hardocded defaults and perhaps in a future PR we can make these configurable (per model?).
Which issue(s) this PR fixes:
Fixes INFRA-751 (internal)
Special notes for your reviewer:
GRPCModelServerLoadTimeout
,GRPCModelServerUnloadTimeout
andGRPCControlPlaneTimeout
V2Config
where these parameters and others can be set and used (so that in the future can be configured)