Inject --enable-preview JVM flag for mongot startup via JAVA_TOOL_OPTIONS

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

        1. Summary

      Temporary workaround for BF-43456: mongot crashes on startup across all `mongot_e2e_` and `concurrency_with_mongot_extension_` CI tasks on master, v8.0, v8.2, and v8.3.

      The `mongot-localdev` tarball (used by CI via `db-contrib-tool setup-mongot-repro-env latest`) currently launches mongot without `--enable-preview`, but the `Similarity` class in the latest mongot build is compiled with Java preview features and requires that flag to load. The result is a `java.lang.UnsatisfiedLinkError` or class-loading crash on every startup.

      The fix injects `JAVA_TOOL_OPTIONS=--enable-preview` into the subprocess environment inside `mongot_program()`. The JVM picks this up automatically regardless of how the startup script invokes `java`, so no changes to the downloaded binary or startup script are needed.

      The root fix is in the mongot repo (adding `--enable-preview` to the `mongot-localdev` startup script and `libmongot_vecsim.so` to the distribution tarball). Once a new `latest` tarball is published with that fix, `JAVA_TOOL_OPTIONS` will become redundant since the flag will come from the script directly — but having it here causes no harm.

        1. Reading order

      `buildscripts/resmokelib/core/programs.py` — the only file changed. Look at `mongot_program()`: three lines that copy the existing `env_vars` dict and add `JAVA_TOOL_OPTIONS`.

        1. Caveats
      • `JAVA_TOOL_OPTIONS` affects any JVM spawned in the same environment; in the resmoke fixture context that's only the mongot subprocess, so the blast radius is minimal.
      • This workaround is intentionally temporary — it can be reverted once the mongot `latest` tarball is updated.

            Assignee:
            Finley Lau
            Reporter:
            Finley Lau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: