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: close httpx connections to avoid memory leaks #895

Merged
merged 1 commit into from
Mar 23, 2025

Conversation

adamdelezuch89
Copy link
Contributor

Fixed an issue where the event loop was closing before all HTTPX connections were properly terminated, causing resource warnings and potential memory leaks. The problem occurred because browser-use was shutting down threads before Playwright had fully closed its HTTP connections. Now, before shutting down the agent, all HTTPX processes are explicitly closed, ensuring a clean shutdown and preventing unclosed transport warnings.

Fixed an issue where the event loop was closing before all HTTPX connections were properly terminated, causing resource warnings and potential memory leaks. The problem occurred because browser-use was shutting down threads before Playwright had fully closed its HTTP connections. Now, before shutting down the agent, all HTTPX processes are explicitly closed, ensuring a clean shutdown and preventing unclosed transport warnings.
@CLAassistant
Copy link

CLAassistant commented Feb 27, 2025

CLA assistant check
All committers have signed the CLA.

@pirate
Copy link
Member

pirate commented Mar 22, 2025

cc @MagMueller

@MagMueller MagMueller merged commit 3e871c6 into browser-use:main Mar 23, 2025
1 check was pending
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.

4 participants