Skip to content

feat(electron): add activateNow() plus fd and GC hardening - #6

Open
itsjithinv wants to merge 1 commit into
mainfrom
feat/live-activation
Open

feat(electron): add activateNow() plus fd and GC hardening#6
itsjithinv wants to merge 1 commit into
mainfrom
feat/live-activation

Conversation

@itsjithinv

Copy link
Copy Markdown
Owner

Adds restart-free activation and fixes the descriptor/GC problems that made in-session bundle swapping unsafe.

  • activateNow(): activates the staged update in the running process. Persists the incremented boot counter before returning, so crash accounting matches the restart path; rolls back instead of crash-looping when attempts are exhausted. Re-seats the boot snapshot that start() previously captured once, without which markHealthy() refuses to promote the newly booted update and the next launch rolls back a healthy release.
  • bundleUrlPredicate option: lets apps that load the staged bundle themselves (e.g. loadFile to keep a file:// origin so localStorage/IndexedDB survive) keep probation crash detection working.
  • Protocol handler reads files <= maxInMemoryBytes (8 MiB) instead of streaming and aborts large-file descriptors with the request, so Chromium cannot hold handles that make the bundle dir undeletable on Windows. bundleRoot may now be a function, so activation re-points it without re-registering the scheme.
  • GC protects every bundle served this process, retries EACCES on deletes, and logs failures instead of swallowing them.
  • Probation watchdog no longer stacks web-contents-created listeners.

Adds restart-free activation and fixes the descriptor/GC problems that made
in-session bundle swapping unsafe.

- activateNow(): activates the staged update in the running process. Persists
  the incremented boot counter before returning, so crash accounting matches
  the restart path; rolls back instead of crash-looping when attempts are
  exhausted. Re-seats the boot snapshot that start() previously captured once,
  without which markHealthy() refuses to promote the newly booted update and
  the next launch rolls back a healthy release.
- bundleUrlPredicate option: lets apps that load the staged bundle themselves
  (e.g. loadFile to keep a file:// origin so localStorage/IndexedDB survive)
  keep probation crash detection working.
- Protocol handler reads files <= maxInMemoryBytes (8 MiB) instead of streaming
  and aborts large-file descriptors with the request, so Chromium cannot hold
  handles that make the bundle dir undeletable on Windows. bundleRoot may now
  be a function, so activation re-points it without re-registering the scheme.
- GC protects every bundle served this process, retries EACCES on deletes, and
  logs failures instead of swallowing them.
- Probation watchdog no longer stacks web-contents-created listeners.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants