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

Random timeout on request #345

Closed
Mattious opened this issue Sep 11, 2019 · 6 comments
Closed

Random timeout on request #345

Mattious opened this issue Sep 11, 2019 · 6 comments
Assignees

Comments

@Mattious
Copy link

Hi,

i've implemented a flow to get release information from a node api by using the package azure-devops-node-api.
I've a strange behaviour. It works perfectly but suddenly i get timeout for the request: connect ETIMEDOUT 13.107.42.18:443

The flow when i get a release status (or also queue a release) is

  • Connect to azure devops api:
import * as vm from 'azure-devops-node-api';
 public async azureDevOpsConnectWebApi(): Promise<vm.WebApi> {
        this._authentificationHandler = vm.getPersonalAccessTokenHandler(this.PAT);
        let option = null;
        this._vstsWebApiConnect = new vm.WebApi(this.AZURE_DEV_OPS_URL, this._authentificationHandler, option);
        return this._vstsWebApiConnect;
    }
  • get the release status
public async getRelease(projectName: string, releaseDefinitionId: number): Promise<releaseInterface.Release> {
       const _self = this;
       try {
// Connect to azure dev api
           const vstsWebApiConnect: vm.WebApi = await AzureDevOpsHelper.getInstance().azureDevOpsConnectWebApi();
           const releaseApiConnect: releaseApi.IReleaseApi = await vstsWebApiConnect.getReleaseApi();
           const release: releaseInterface.Release = await releaseApiConnect.getRelease(projectName, releaseDefinitionId);
           return release;
       } catch (error) {
           LogUtils.Instance.error(`** AzureDevOpsReleaseHelper - getRelease ${projectName} - ${releaseDefinitionId}: ${error}`);
           throw error;
       }
   }

The time out can occurs on the connection on azure devops api or during get release.

Functionnality can work 50 times but suddenly he next 5 requests failed. Or directly failed and suddenly works.

Can you provide me support or explain what i can do to avoid that ?

Thanks in advance

@damccorm
Copy link

damccorm commented Oct 7, 2019

This seems like its probably just network issues, I can't get a repro. With that said, one thing you can do to make this moreresilient is to use retries

@damccorm
Copy link

damccorm commented Nov 1, 2019

Note also that you can increase the timeout -

@Metarract
Copy link

Metarract commented Dec 2, 2019

Also ran into this same issue; I chalked it up to ado throttling me and just increased the timeout to ridiculous amounts but ended up still getting a timeout error and didn't end up seeing any throttling in our usage section for me. Increased it to like 4 hours (assuming the socketTimeout was ms based on testing; if it's in s then it sure was a lot more than that), still timed out before it hit that amount. Set it to 0 hoping it would remove timeouts like some request modules but it still timed out a bunch.

We're trying to get info on around 10k releases for audit purposes, I dunno if the number affects it at all. I assume this is hard to repro since it's extremely intermittent but out of around 10k releases it timed out around 30 times. Also set retries to 5 but going to try with more I guess.

EDIT: Just ran this again with maxRetries of 20 and a super high timeout, call times out regardless within a few minutes once I get to around 6200 api calls, successfully runs a few, times out again. This pattern continues until we hit the end.

@iMPeRiOR
Copy link

Hi Guys, I have the same issue on getBranches() method, after a random time it gets timeout, but network is stable, and I've setup high timeout and retries values.

@github-actions
Copy link

This issue has had no activity in 90 days. Please comment if it is not actually stale

@rfennell
Copy link

I am still seeing this issue intermittently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants