Skip to content

Fix for #2736 timeout error: ETIMEDOUT when pushing new developer template #2746

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

Open
wants to merge 336 commits into
base: master
Choose a base branch
from

Conversation

annaji-msft
Copy link
Member

This pull request introduces a retry mechanism for HTTP requests in the scripts.v2/utils.js file. The main changes include adding a new function to handle retries and updating the existing request function to utilize this retry logic.

Key changes:

  • Added a sendRetryRequest function to handle retry logic for HTTP requests. This function retries the request up to four times with a 10-second delay between attempts.
  • Updated the request function to use the new sendRetryRequest function. This includes adding a timeout of 2 minutes for each request and logging retry attempts and errors. [1] [2]

#2736

azaslonov and others added 30 commits July 22, 2022 16:24
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
Co-authored-by: Jan Mach <janmach1@microsoft.com>
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
…re#1897)

Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
added additional Lru cache for operation definitions
minor fix for syntax highlighter
Co-authored-by: Farhad Alizada <falizada@microsoft.com>
Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
* displayName required

* overrides handling - no longer valid override cleanup

* customWidgetList refresh configs in constructor

* listenForSecretsRequests managementApiUrl + ensureUrlArmified
…zure#1935)

Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
ygrik and others added 21 commits October 4, 2024 11:00
* Migrated declarations.
* Upgraded designer styles.
* Updated packages and fixed styles

---------

Co-authored-by: Alexander Zaslonov <alzaslon@microsoft.com>
… media modal

**Problem:**
Link image doesn't work for media because of missed property compared to schema

**Solution:**
Fixed

**Synchronization:**
_Describe If there is any condition to merge this code to main repository. Link any PR that is needed to be deployed together with this PR._

**Type of change:**

- [ ] Feature work
- [X] Bugfix
- [ ] Security patch
- [ ] Documentation
- [ ] Engineering change
- [ ] Test
- [ ] Logging/Metrics

_Before submitting this PR, please make sure that the following are done_:

- [ ] There is sufficient test coverage (unit/BVT)
- [ ] There is sufficient logging and metrics to troubleshoot in production. Ensured PII is not logged
- [ ] Validated that it is not introducing breaking changes in the product behavior

**Risk**:

- [ ] High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high-level infrastructure changes)
- [ ] Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
- [X] Small – No issues are expected. (Example: Very small bugfixes, string changes, or configuration settings changes)

Related work items: #29755670
**Problem:**
When you try to put value to reference url in limk media dialog, the value is not updated

**Solution:**
Fixed state updates

**Synchronization:**
_Describe If there is any condition to merge this code to main repository. Link any PR that is needed to be deployed together with this PR._

**Type of change:**

- [ ] Feature work
- [X] Bugfix
- [ ] Security patch
- [ ] Documentation
- [ ] Engineering change
- [ ] Test
- [ ] Logging/Metrics

_Before submitting this PR, please make sure that the following are done_:

- [X] There is sufficient test coverage (unit/BVT)
- [ ] There is sufficient logging and metrics to troubleshoot in production. Ensured PII is not logged
- [X] Validated that it is not introducing breaking changes in the product behavior

**Risk**:

- [ ] High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high-level infrastructure changes)
- [ ] Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
- [X] Small – No issues are expected. (Example: Very small bugfixes, string changes, or configuration settings changes)

Related work items: #29755670
* Fixed styles after last packages update

* Returned default styles from style guide
* Removed unnecessary imports from styles

* Fixed admin dropdown on small screen resolutions
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
Fixed scrolling on subscription rename/cancel
* Update package.json engines to require Node pre v20

* upd
Add retry mechanism and increase timeout for HTTP requests to mitigate ETIMEDOUT errors.

* Add `sendRetryRequest` function in `scripts.v2/utils.js` to handle retries for HTTP requests with a maximum of 4 retries and a 10-second delay between retries.
* Update the `request` function in `scripts.v2/utils.js` to use the `sendRetryRequest` function.
* Set the timeout to 120000 milliseconds (2 minutes) in the `options` object in `scripts.v2/utils.js`.
* Update the `execSync` calls in `scripts.v3/migrate.js` to use the `sendRetryRequest` function.
Fix timeout error when pushing new developer template
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

scripts.v2/utils.js:63

  • [nitpick] The 'process' parameter is not well-documented. It should either be documented or removed if not necessary.
async function sendRetryRequest(method, url, accessToken, body, process = "") {

scripts.v2/utils.js:146

  • The error message for 'UnhandledError' could be more descriptive to help with debugging.
reject({ code: "UnhandledError", message: `Could not complete request to ${url}. Status: ${resp.statusCode} ${resp.statusMessage}` });

@annaji-msft annaji-msft changed the title Fix for #2736 Fix for #2736 timeout error: ETIMEDOUT when pushing new developer template Jan 15, 2025
@azaslonov azaslonov force-pushed the master branch 4 times, most recently from 79dae19 to a74f7db Compare March 21, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.