8. Chrome process invocation and lifecycle management #10

Closed
opened 2026-05-20 15:31:17 -06:00 by ppreeper · 0 comments
Owner

Description

Implement the Chrome subprocess invocation with proper lifecycle management.

Tasks

  • Build complete Chrome command line from translated args
  • Always include required headless flags:
    • --headless=new
    • --disable-gpu
    • --no-sandbox
    • --disable-dev-shm-usage
  • Use subprocess.run() to invoke Chrome
  • Capture stderr for logging/error reporting
  • Forward Chrome stderr to wrapper stderr (unless --quiet)
  • Handle Chrome exit codes and map to wkhtmltopdf exit codes
  • Handle Chrome crashes (exit code 2)
  • Handle timeout (exit code 3)

Acceptance Criteria

  • Chrome invoked with correct full command line
  • Required headless flags always present
  • PDF output file created at specified path
  • Chrome stderr visible on wrapper stderr (unless --quiet)
  • Chrome crash → exit code 2
  • Chrome timeout → exit code 3
  • Chrome success → exit code 0

Notes

  • Use subprocess.run() with capture_output=True
  • Relates to PRD #2
## Description Implement the Chrome subprocess invocation with proper lifecycle management. ## Tasks - [ ] Build complete Chrome command line from translated args - [ ] Always include required headless flags: - `--headless=new` - `--disable-gpu` - `--no-sandbox` - `--disable-dev-shm-usage` - [ ] Use `subprocess.run()` to invoke Chrome - [ ] Capture stderr for logging/error reporting - [ ] Forward Chrome stderr to wrapper stderr (unless `--quiet`) - [ ] Handle Chrome exit codes and map to wkhtmltopdf exit codes - [ ] Handle Chrome crashes (exit code 2) - [ ] Handle timeout (exit code 3) ## Acceptance Criteria - Chrome invoked with correct full command line - Required headless flags always present - PDF output file created at specified path - Chrome stderr visible on wrapper stderr (unless `--quiet`) - Chrome crash → exit code 2 - Chrome timeout → exit code 3 - Chrome success → exit code 0 ## Notes - Use `subprocess.run()` with `capture_output=True` - Relates to PRD #2
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ppreeper/wkhtmltopdf#10
No description provided.