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

fix: clear pending TLS socket handle #10667

Merged

Conversation

christian-bromann
Copy link
Contributor

@christian-bromann christian-bromann commented Jul 31, 2023

What kind of change does this PR introduce?

I recognised when calling canDownload the @puppeteer/browsers package makes a HEAD request, e.g. to https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5793.0/mac-arm64/chrome-mac-arm64.zip. This causes the Node.js process to stale as there stay pending TLSSocket around

Did you add tests for your changes?

I am currently working on webdriverio/webdriverio#10767 and have been encountered this issue. Adding given code line resolves it.

My current workaround is:

setTimeout(() => {
    for (const handle of process._getActiveHandles()) {
        if (handle.servername && handle.servername.includes('edgedl.me')) {
            handle.destroy()
        }
    }
}, 10)

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

I don't think so.

Other information

@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Jul 31, 2023

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@Lightning00Blade Lightning00Blade changed the title (bugfix): clear pending TLS socket handle fix: clear pending TLS socket handle Aug 1, 2023
@Lightning00Blade
Copy link
Collaborator

Thank you for your PR, I left a small comment and after #10668 is merged test should pass as well.

@christian-bromann christian-bromann force-pushed the cb-pending-tlssocket branch 2 times, most recently from 12edc57 to 01effac Compare August 1, 2023 16:12
@christian-bromann
Copy link
Contributor Author

Thanks for the review @Lightning00Blade!

You are totally right, request.resume() is the right thing to call here. Update the PR and PR message, everything should pass now.

@Lightning00Blade Lightning00Blade merged commit 87bd791 into puppeteer:main Aug 1, 2023
19 checks passed
@release-please release-please bot mentioned this pull request Aug 1, 2023
@christian-bromann christian-bromann deleted the cb-pending-tlssocket branch August 1, 2023 16:49
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.

None yet

2 participants