-
Notifications
You must be signed in to change notification settings - Fork 105
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(cli, studio): don't retry on non request/http errors #907
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #907 +/- ##
=======================================
Coverage 87.69% 87.69%
=======================================
Files 130 130
Lines 11661 11665 +4
Branches 1586 1586
=======================================
+ Hits 10226 10230 +4
Misses 1038 1038
Partials 397 397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dede005
to
7acb0f7
Compare
Deploying datachain-documentation with
|
Latest commit: |
7acb0f7
|
Status: | ✅ Deploy successful! |
Preview URL: | https://16cfc44e.datachain-documentation.pages.dev |
Branch Preview URL: | https://fix-cli-hangs-on-get-team-ex.datachain-documentation.pages.dev |
def _send_request( | ||
self, route: str, data: dict[str, Any], method: Optional[str] = "POST" | ||
) -> Response[Any]: | ||
""" | ||
Function that communicate Studio API. | ||
It will raise an exception, and try to retry, if 5xx status code is | ||
returned, or if ConnectionError or Timeout exceptions are thrown from | ||
requests lib | ||
returned, or if Timeout exceptions is thrown from the requests lib |
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.
[C]: removed ConnectionError
from the one we retry on. It is usually Proxy, or something SSL - don't think we can recover from those
W/o this fix, if team is not set via env variable
DVC_STUDIO_TEAM
and / or DataChain config,self.team
in Studio remote client raises aDataChainError
(which is fine). What is not fine is that_send_request
keeps retying with an exponential backoff on those.Pretty much means that first time someone is trying to run something like
datachain ds pull ...
there are big chances to hit a long hang w/o any messages at all. Then if you are like to wait you can see that it just expect team to be set.Also improves the messaging around
get_team
errors a bit.TODO: