Skip to content

fix: read the tail of chrome-err.log - #369

Merged
paulirish merged 3 commits into
GoogleChrome:mainfrom
MaciejZet:fix/stderr-log-tail
Nov 4, 2026
Merged

paulirish merged 3 commits into
GoogleChrome:mainfrom
MaciejZet:fix/stderr-log-tail

Conversation

@MaciejZet

@MaciejZet MaciejZet commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

waitUntilReady was loading all of chrome-err.log with readFileSync. Past 2 GiB that throws ERR_FS_FILE_TOO_LARGE, which is exactly when the debugging port is being read from the log.

The check now reads at most the last 1 MiB and uses the latest DevTools listening line. The file is left as Chrome wrote it.

Test plan

  • yarn test — 47 passed
  • marker exactly at the 1 MiB tail boundary
  • several markers in the tail use the last port
  • missing marker rejects with the existing readiness error
  • sparse 3055630622-byte log where readFileSync throws and the port at the end is still found
  • yarn build
  • yarn type-check
  • repository clang-format check

Fixes #293

readFileSync throws ERR_FS_FILE_TOO_LARGE once the append-only log passes 2 GiB. Readiness now reads at most the last 1 MiB and uses the latest DevTools listening line.

Fixes GoogleChrome#293
@paulirish
paulirish enabled auto-merge (squash) October 5, 2026 17:39
@MaciejZet

Copy link
Copy Markdown
Contributor Author

Local results for f773f14 on macOS arm64, with Node 22.23.3, 24.22.0 and 26.12.0: all three passed the full suite (53 tests on this PR, 47 on main), build and type-check. Source formatting matches the bundled clang-format 11 via Rosetta. Real Chrome 155 also started successfully with a 3,055,630,622-byte sparse stderr log containing no old port marker. Linux/Windows CI was not run locally.

A separate reused-log test still picks an old port before Chrome writes its new marker, then keeps retrying that port. This reproduces on both main and this PR and is outside the bounded-read fix; selecting the last marker does not resolve that startup-ordering case.

@paulirish
paulirish disabled auto-merge November 4, 2026 20:03
@paulirish
paulirish merged commit 017c750 into GoogleChrome:main Nov 4, 2026
6 checks passed
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.

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (3055630622) is greater than 2 GiB

2 participants