Closed Bug 1840515 Opened 11 months ago Closed 10 months ago

Preload the omnijars in the fork server

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: jld, Assigned: jld)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

See bug 1840512 for more details, but, the fork server process should open the omnijar files (if present; an unpackaged build run via ./mach run doesn't have them) before forking, so the child processes inherit the original files even if they're replaced or removed.

Fortunately, it's possible to initialize mozilla::Omnijar — a process which includes instantiating nsLocalFile — without starting XPCOM, and comments indicate that we're already doing this on Android, so it should be relatively well tested already.

The goal of this patch is to ensure that the forked child processes will
have the correct jar files already opened, even after they're replaced
by an update or removed from the filesystem.

We're already doing something vaguely similar for child processes on
Android, so this patch builds on it. The fork server is now given
command-line flags with both omnijar paths, so that it won't need to
use the XPCOM directory service to find them, and then uses them to
initialize the Omnijar class (which also doesn't require XPCOM) before
forking.

The -appomni flag isn't currently used, but the next patch will bring
it back and change how both flags are processed in child processes.

Attachment #9341794 - Attachment description: Bug 1840515 - Preload the omnijars in the fork server. → Bug 1840515 - Step 1: Use -greomni/-appomni for content processes.

This extends the previous support for -greomni and -appomni to the
fork server, so that it can pre-open the jar files and thus continue
using the correct versions in forked child processes even if the files on
disk are replaced by an update or deleted.

Pushed by jedavis@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8f0ce073d4fc
Step 0: Use GeckoArgs for the `-greomni` and `-appomni` flags. r=nika
https://hg.mozilla.org/integration/autoland/rev/e35715879bf8
Step 1: Use -greomni/-appomni for content processes. r=nika,mhowell
https://hg.mozilla.org/integration/autoland/rev/3a910f33826b
Step 2: Preload the omnijars in the fork server. r=nika
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
Regressions: 1851271
Regressions: 1875412
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: