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 Chrome restart, enhance connection options and logging #779

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

Conversation

turicas
Copy link

@turicas turicas commented Feb 25, 2024

Overview of changes:

  • I had a bad time running prerender and it was very difficult to check what was really happening, since some exceptions did not show the error message or variables, so I enhanced the logging for chrome.connect and chrome.openTab
  • Added the Chrome host as an option (could be used to force IPv4/IPv6 or to run Chrome remotely)
  • Fixed Chrome restart procedure - now the main browser process is detached, so we can SIGINT the whole process group (prerender was not connecting).

Probably related to/fixes #761 #775 #758 #755 #753

This will make possible to connect in browsers running on other hosts or
even forcing IPv4 or IPv6.
The main browser process is now spawn detached, which mean it'll be the
group owner of its children (Chrome will spawn new processes). This way
we can send a SIGINT for the whole group and fix the restart procedure
(before this change prerender could not connect to the browser after a
restart).
@turicas turicas changed the title Enhancement connection options and logging Fix Chrome restart, enhance connection options and logging Feb 25, 2024
@turicas
Copy link
Author

turicas commented Feb 25, 2024

I deployed the latest version of this branch with this custom server.js on Debian running inside a container (used this Dockerfile). My deployment have 1 nginx as a reverse proxy and 4 containers running this version of prerender.
Then, I made dozens of thousands of requests to it. Each container restarted the browser 57 times since the time I started the test (without errors) and everything is running smoothly (no 5xx errors, no restart errors, all old Chromium processes were killed and file system cache is working perfectly).

boldtrn added a commit to boldtrn/prerender-alpine that referenced this pull request Apr 18, 2024
boldtrn added a commit to boldtrn/prerender-alpine that referenced this pull request Apr 18, 2024
@dswiecki
Copy link

@turicas @lluczo @avelinesg Can we merge this PR, I confirm it fixes the #761 #775 #758 #755 #753

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.

Timed out waiting for Chrome connection after Restarting Chrome
2 participants