Skip to content
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

Resource Provisioner: add retries to network calls #326

Closed
danieljurek opened this issue Jan 15, 2020 · 5 comments · Fixed by Azure/azure-sdk-for-net#9504
Closed

Resource Provisioner: add retries to network calls #326

danieljurek opened this issue Jan 15, 2020 · 5 comments · Fixed by Azure/azure-sdk-for-net#9504
Assignees
Labels
EngSys This issue is impacting the engineering system.

Comments

@danieljurek
Copy link
Member

We've seen an error on Connect-AzAccount in a pipeline execution where other jobs have succeeded on this call. The cause might be a transient network issue. To that end we could wrap network calls in retries with some detection of transient errors (e.g. network timeout, 5xx status code, etc.) and retry on errors that look transient.

Logs of this behavior: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=234118&view=logs&jobId=42c9484e-bad6-5a7b-ceb1-abf0d427bbf2&j=42c9484e-bad6-5a7b-ceb1-abf0d427bbf2&t=05996a6a-8093-5d15-a4af-44930c1872b9

@danieljurek danieljurek added the EngSys This issue is impacting the engineering system. label Jan 15, 2020
@danieljurek
Copy link
Member Author

Might also make sense to use the -Debug flag on calls to Az

@heaths
Copy link
Member

heaths commented Jan 16, 2020

Testing -Debug, this can only be done in non-interactive PowerShell sessions otherwise it, as it should, prompts with each line. You can turn most of that off with -Confirm:$false but there are sub-scripts that still prompt, meaning you would probably have to set Set-PSDebug with the right parameters. I.e. it's not straight forward to do this. Write-Debug is meant solely for debugging. They should've used Write-Verbose to output more information. I think it's risky to try to do anything other than retrying at this point.

/cc @mikeharder

@mikeharder
Copy link
Member

@heaths: Are you saying there is no good way to get more detailed information from CLI failures?

@heaths
Copy link
Member

heaths commented Jan 16, 2020

Not using -Debug - not without taking into account all the gotchas that entails to work correctly in both CIs and interactive. Good information like that should've used Write-Verbose. That said, I can still use trap or catch (depending on whether the exception is thrown out from the cmdlet or just an error record written) and dump any information that might be useful.

@heaths
Copy link
Member

heaths commented Jan 16, 2020

If I set $DebugPreference to 'Continue' and run in non-interactive mode, I can seemingly get this to work but do we gate that all on our $CI switch parameter? That information wouldn't benefit customers, since an interactive session is what we'd expect them to run. It's this various permutations to support that worry me. Catching that exception and dumping information would work in either case.

heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Jan 16, 2020
Fixes Azure/azure-sdk-tools#326 by retrying login and dumping more information about why it might have failed.
heaths added a commit to Azure/azure-sdk-for-net that referenced this issue Jan 16, 2020
* Retry account login

Fixes Azure/azure-sdk-tools#326 by retrying login and dumping more information about why it might have failed.

* Change initial sleep to 5s

Had as 1s for testing and forgot to change it back.
heaths added a commit to heaths/azure-sdk-for-net that referenced this issue Jan 16, 2020
heaths added a commit to Azure/azure-sdk-for-net that referenced this issue Jan 16, 2020
heaths added a commit to heaths/azure-sdk-for-js that referenced this issue Jan 17, 2020
heaths added a commit to Azure/azure-sdk-for-js that referenced this issue Jan 17, 2020
sima-zhu pushed a commit to sima-zhu/azure-sdk-tools that referenced this issue Dec 3, 2020
Add APIVersion policy
  -Policy adds the service version to all requests.
  -Service can be set on headers or query parameters

Rename boolean for clarity.
Add comment describing how the boolean operates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EngSys This issue is impacting the engineering system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants