-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Ignore timeout error while polling operation status from ARM #11531
Conversation
… users/dikhakha/IgnoreTimeoutWhilePolling
@bishal-pdMSFT / @arjgupta / @vinodkumar3 Can you please have a look at this PR ? |
} | ||
catch (error) { | ||
let errorString: string = (error && error.toString()) || ""; | ||
if(errorString && errorString.toLowerCase().indexOf("request timeout") >= 0 && ignoreTimeoutErrorThreshold > 0) { |
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.
is there something more to look for than just "request timeout"?
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.
The error is of form "Request Timeout: ", so I think this should be good enough.
if (response.headers["retry-after"]) { | ||
sleepDuration = parseInt(response.headers["retry-after"]); | ||
else { | ||
throw error; |
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.
just throw
? Not sure about javascript but in C# throw error
would change the call stack
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.
In javascript, you can re throw the error which will preserve the stack by doing: throw error
. throw new Error(error)
will lead to stack trace being lost.
I think you might need to update the patch version of many tasks depending upon task common lib |
This functionality is not absolutely required by other tasks who are using this module. Do you think there is need to update other tasks version ? I will update for this task |
… users/dikhakha/IgnoreTimeoutWhilePolling
…thub.com/Microsoft/vsts-tasks into users/dikhakha/IgnoreTimeoutWhilePolling
I see that build itself will fail if tasks consuming this common is not updated. Will update other task versions as well. Thanks |
* ignore timeout error while polling for operation * add ignore timeout error threshold * review comments * updating tasks version using common module
Ignore timeout error when we poll for ARM operation status. This is to avoid failing in case poll operation request timed out due to ARM taking long time to process the request. The operation could have ended up successfully however the tasks fails because of this.