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

feat: retry timeout errors #34284

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Jan 10, 2025

Closes #34207

@Skn0tt Skn0tt requested review from dgozman and Copilot January 10, 2025 13:58
@Skn0tt Skn0tt self-assigned this Jan 10, 2025

Choose a reason for hiding this comment

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

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

@dgozman dgozman requested a review from yury-s January 10, 2025 14:11
@dgozman
Copy link
Contributor

dgozman commented Jan 10, 2025

I'd prefer Yury to take a look.

Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › tests/reporter-html.spec.ts:2649:5 › created › execSync doesnt produce a second stdout attachment @macos-latest-node18-2

4 flaky ⚠️ [firefox-page] › tests/page/page-evaluate.spec.ts:403:3 › should throw for too deep reference chain @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › tests/ui-mode-test-ct.spec.ts:59:5 › should run component tests after editing test @ubuntu-latest-node22-1
⚠️ [webkit-library] › tests/library/browsertype-launch.spec.ts:72:3 › should reject if executable path is invalid @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › tests/page/page-set-input-files.spec.ts:147:3 › should upload large file @webkit-ubuntu-22.04-node18

37576 passed, 648 skipped
✔️✔️✔️

Merge workflow run.

@@ -134,7 +134,7 @@ Defaults to `20`. Pass `0` to not follow redirects.
* since: v1.46
- `maxRetries` <[int]>

Maximum number of times network errors should be retried. Currently only `ECONNRESET` error is retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Maximum number of times network errors should be retried. Only `ECONNRESET` and timeout errors are retried. Does not retry based on HTTP response codes. An error will be thrown if the limit is exceeded. Defaults to `0` - no retries.
Copy link
Member

Choose a reason for hiding this comment

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

What are the timeout errors that are retried? Does it now mean that overall timeout is maxRetries x timeout? I'm not sure I like the latter. If we want to support this, we could just add ETIMEDOUT (socket timeouts) to the retryable error codes and keep old semantics of the timeout parameter, i.e. if ETIMEDOUT occurs and the deadline is not reached yet (and retries count < maxRetries), we will retry, otherwise we bail out. I don't think we want to retry errors where the server received the request but was got stuck processing it and was not able to finish its response on time.

Copy link
Member Author

Choose a reason for hiding this comment

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

that makes sense. fiddling with the deadline parameter already felt wrong to me. i'll rewrite it to only ETIMEDOUT.

Copy link
Member Author

Choose a reason for hiding this comment

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

After looking into this more, I think that won't work. ETIMEDOUT is the error that occurs when a socket idles for a specified amount of time. By default, there's no timeout. So unless we add API for configuring socket timeout, we won't be able to retry ETIMEDOUT.

Most other forms of timeout i've tested show up as ECONNRESET, so they're already being retried today.

You're saying "we don't want to retry when the server got stuck processing", but given this I'm pretty sure that's what the user report is about. Let's discuss this more tonight.

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.

[Feature]: Include timeouts for APIRequestContext maxRetries option
3 participants