fix(python): close browser server on launcher shutdown - #684
Open
Cloudymap1e wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Closes #172
Description
The Python server launcher previously closed stdin immediately after sending configuration, while the Node process then used that same stream only as a keepalive. That prevented stdin EOF from representing controller shutdown and left BrowserServer cleanup dependent on abrupt process termination.
Python now sends one newline-delimited base64 configuration frame and keeps the pipe open. The Node launcher parses exactly that first frame, latches early stream termination, and treats later stdin end, close, or error as a shutdown request. It closes BrowserServer before exiting so Playwright can remove its temporary profile. The Python side closes the control pipe and reaps the child with bounded terminate/kill fallbacks for interruptions during write, flush, or wait.
Type of Change
Testing
python -m pytest pythonlib/tests/test_server.py -q: 8 passedpython -m pytest pythonlib/tests -q: 48 passed, 4 skippednode --check pythonlib/camoufox/launchServer.js: passedFingerprint Report
Not applicable: this changes the Python/Node server lifecycle and does not alter fingerprint behavior.
Checklist
Service tests pass (for python library changes) -temporarily out of service lol./service-tester/run_tests.sh --browser-version official/prerelease/146.0.1-alpha.25(attach screenshot)