You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have try/except logic that catches various errors from the api-server when making requests. We should try be a bit more smart about them though as often these errors mean we should retry the attempt rather than raising an exception that leads to a 500 error raised by JupyterHub for a user starting a pod for example.
Here are k8s api-server response status codes that is recommended to be followed by a retry of the request according to the Kubernetes community documentation.
asyncdefretrying_api_request():
try:
return (awaitreal_api_request()) orTrue# ensure truthy, or is the response always truthy?exceptApiExceptionase:
ife.statusinRETRY_ERROR_CODES:
# any special-handling of e.g. 429 with may have a specified retry-after header?log.warning(f"Error {e.status} in API request: {e}, retrying...")
returnFalse# let any other error raiseraiseresult=awaitexponential_backoff(retrying_api_request, ...)
wrapper to use for all API requests seems appropriate. This can probably be folded into (or replace) our current asynchronize utility.
Bug description
We have try/except logic that catches various errors from the api-server when making requests. We should try be a bit more smart about them though as often these errors mean we should retry the attempt rather than raising an exception that leads to a 500 error raised by JupyterHub for a user starting a pod for example.
kubespawner/kubespawner/spawner.py
Lines 1830 to 1834 in 76ad4e9
Response status codes to consider
Here are k8s api-server response status codes that is recommended to be followed by a retry of the request according to the Kubernetes community documentation.
Related
This issue is the outcome of reviewing another pr, see: #433 (review)
The text was updated successfully, but these errors were encountered: