Skip to content

Fix Chrome restart, enhance connection options and logging#779

Open
turicas wants to merge 4 commits intoprerender:masterfrom
PythonicCafe:enhancement/connection
Open

Fix Chrome restart, enhance connection options and logging#779
turicas wants to merge 4 commits intoprerender:masterfrom
PythonicCafe:enhancement/connection

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.
@turicas turicas force-pushed the enhancement/connection branch from 1c0a93c to 20aefcf Compare February 25, 2024 04:09
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

@glibvoronin
Copy link

Any progress on this one?

@nico-lachner
Copy link

Is there a chance this will be merged?

Ashwin-op added a commit to commudle/prerender that referenced this pull request Sep 22, 2025
@Vrq
Copy link

Vrq commented Oct 17, 2025

Is this repository still maintained @thoop?

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

5 participants