Repository navigation
fix(docs): stagger wheels JVM starts so concurrent blocks don't race in Lucee's bundle cache - #4452
Conversation
…in Lucee's bundle cache
JVMs starting at the same moment in one CLI home race in Lucee's OSGi bundle
cache ('Bundle symbolic name and version are not unique', then a null script
engine) and fail or stall. runExec() now starts wheels commands one at a time,
each WHEELS_START_GAP_MS (default 1 s) after the previous one; they still run
in parallel once started. On 12 four-way runs: no gap failed 6, 250 ms and up
failed none. felix.cache.locking=true did not help (3/12 failed).
The verify-docs counts test runs the real four-way path again and no longer
skips on CI.
Closes #4450.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
|
rev1-r3 review @ 66c69a7: code APPROVE (final pending PR CI) This is the real fix for #4450, and it removes #4451's stopgap as agreed. Start gate.
Evidence. The measurement table makes the case. No gap fails 4 of 12 runs and ordering alone 6 of 12, while any gap of 250 ms or more fails 0 of 12. Test 51. It is back on the real four-way path, with no New tests. A fake Two notes, not blocking:
Gate: PR CI ( |
|
rev1-r3 review @ 66c69a7: APPROVE (final) PR CI is now 20 pass / 0 fail / 0 pending, with 3 skipping. In
The wall-time concern from my review is answered. This PR's Ready to merge. This closes #4450. |
Closes #4450.
Summary
Docs-harness
wheelscommands failed intermittently, or stalled on CI, when several started at the same moment.Cause: concurrent JVM starts in one CLI home race in Lucee's OSGi bundle cache:
BundleException: Bundle symbolic name and version are not unique(org.lucee.xml.apis,commons-text, …);Cannot invoke "javax.script.ScriptEngine.put(…)" because "engine" is null.Lucee's loader runs with
felix.cache.locking=falseand installs its required bundles on every JVM start, so two JVMs starting together collide.verify-docsruns blocks four at a time, and since #4425 every run gets a fresh home.Fix:
runExec()now startswheelscommands one at a time, eachWHEELS_START_GAP_MS(default 1 s) after the previous start. Once started, they still run in parallel, and other programs aren't gated. If a spawn throws, the next start isn't held up.Measured with 12 runs of
verify-docson the sample at four-way concurrency:-Dfelix.cache.locking=true, no gaplucee-server/into the homeNeither of the last two helps, so a start gate is the fix on our side. A draft upstream report for the Lucee/LuCLI side exists (not posted). Users running several
wheelscommands at once against one home can hit the same race.Test 51 ("verify-docs reports pass/fail counts") now runs the real four-way path again. It no longer sets
VERIFY_DOCS_CONCURRENCY=1or skips on CI (both added as a stopgap in #4451). It keeps the 60 s command bound and the child's output in its failure message.Tests
test/exec.test.mjs:wheelscalled three times at once starts ≥ 600 ms apart with a 1 s gap;WHEELS_START_GAP_MSparsing.pnpm test:docs-harness: 76 / 76 in 83 s.🤖 Generated with Claude Code