Skip to content

Commit 3b02c0d

Browse files
rustyconoverclaude
andcommitted
ci: add shm transport lane (matrix); document http worker gap
Run the integration suite as a transport matrix: - launch: the AF_UNIX worker pool (as before). - shm: launch + the POSIX shared-memory side channel (VGI_RPC_SHM_SIZE_BYTES). Validated locally at 171 pass / 13 skip / 0 fail (identical to launch). run-integration.sh gains a TRANSPORT=launch|http switch and a VGI_RPC_SHM_SIZE_BYTES passthrough. TRANSPORT=http works locally but is NOT a CI lane: comparing against the canonical vgi-python http worker showed it passes sequence.test (table-function streaming) over http while the Java worker errors on it. The haybarn runner's built-in skip_error_messages HTTP policy masks those as skips, so an http run looks green while silently dropping ~table tests. The Java HTTP streaming path needs a fix before http can be a real lane; documented in ci/README.md and the script. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 43ac20e commit 3b02c0d

3 files changed

Lines changed: 81 additions & 10 deletions

File tree

.github/workflows/integration.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ env:
3636
jobs:
3737
integration:
3838
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
# launch: the AF_UNIX worker pool. shm: same, plus the POSIX
44+
# shared-memory side channel (VGI_RPC_SHM_SIZE_BYTES).
45+
- { lane: launch }
46+
- { lane: shm, shm_bytes: '67108864' }
47+
name: integration (${{ matrix.lane }})
3948
steps:
4049
- name: Checkout vgi-java
4150
uses: actions/checkout@v4
@@ -78,10 +87,12 @@ jobs:
7887
env:
7988
GH_TOKEN: ${{ github.token }}
8089

81-
- name: Run integration suite
90+
- name: Run integration suite (${{ matrix.lane }})
8291
run: ci/run-integration.sh
8392
env:
8493
VGI_SRC: ${{ github.workspace }}/vgi-upstream
8594
VGI_WORKER_BIN: ${{ github.workspace }}/vgi-example-worker/build/install/vgi-example-worker/bin/vgi-example-worker
95+
# Empty for the launch lane; run-integration.sh drops an empty value.
96+
VGI_RPC_SHM_SIZE_BYTES: ${{ matrix.shm_bytes || '' }}
8697
# JDK 25 + native access for the worker JVM (FFM shm, haybarn_jdbc).
8798
JAVA_TOOL_OPTIONS: --enable-native-access=ALL-UNNAMED

ci/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ extension from the Haybarn community channel:
2929
[`wrappers/`](wrappers), warms the extension cache once, then runs each
3030
`.test` and tallies pass / skip / fail.
3131

32+
## Transport lanes
33+
34+
The workflow runs a matrix over transports (`run-integration.sh` honours
35+
`TRANSPORT=launch|http` and a `VGI_RPC_SHM_SIZE_BYTES` passthrough):
36+
37+
- **`launch`** — the AF_UNIX worker pool (default).
38+
- **`shm`**`launch` plus the POSIX shared-memory side channel
39+
(`VGI_RPC_SHM_SIZE_BYTES`); needs JDK 22+ (`--enable-native-access`).
40+
41+
**`http` is intentionally *not* a CI lane yet.** `TRANSPORT=http` works locally
42+
(it boots the worker with `--http` and attaches over `http://`), but the Java
43+
worker's HTTP transport has a known gap: **table-function streaming** (e.g.
44+
`example.sequence(...)`) errors over http where the vgi-python worker succeeds.
45+
The haybarn runner has a built-in `skip_error_messages HTTP` policy that turns
46+
those errors into *skips*, so an http run looks green (0 fail) while silently
47+
dropping the broken table tests. Promoting http to the matrix should wait until
48+
that streaming path is fixed. (`subprocess` was skipped as low-value — same
49+
logic as `launch` but with per-ATTACH JVM cold-start.)
50+
3251
Out of scope and excluded: `writable/`, `simple_writable/` (the port is
3352
read-only), `nested_type_combinations.test` (segfaults the upstream runner —
3453
see the project `CLAUDE.md`), and `bool_in_union.test` (characterizes a

ci/run-integration.sh

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,57 @@ mkdir -p "$STAGE/test/sql/integration"
3939
awk -f "$HERE/preprocess-require.awk" "$f" > "$STAGE/test/sql/integration/$f"
4040
done )
4141

42-
# launch: amortises the JVM cold-start across the whole run via a flock-coordinated
43-
# AF_UNIX worker pool. VGI_TEST_DEDICATED_WORKER is a plain (non-pooled) worker for
44-
# the crash/pool-recovery tests. The three wrappers route the one binary into the
45-
# versioned / versioned_tables / attach_options catalogs.
42+
# Transport selection (TRANSPORT=launch|http; default launch):
43+
# launch — flock-coordinated AF_UNIX worker pool, amortising JVM cold-start
44+
# across the run. Set VGI_RPC_SHM_SIZE_BYTES to also exercise the
45+
# shared-memory side channel (the `shm` lane).
46+
# http — boot the worker as an HTTP server and attach over http:// (mirrors
47+
# vgi's `make test_http`).
4648
export VGI_WORKER_BIN
47-
export VGI_TEST_WORKER="launch:${VGI_WORKER_BIN}"
48-
export VGI_TEST_DEDICATED_WORKER="${VGI_WORKER_BIN}"
49-
export VGI_VERSIONED_WORKER="launch:${HERE}/wrappers/vgi-worker-versioned"
50-
export VGI_VERSIONED_TABLES_WORKER="launch:${HERE}/wrappers/vgi-worker-versioned-tables"
51-
export VGI_ATTACH_OPTIONS_WORKER="launch:${HERE}/wrappers/vgi-worker-attach-options"
49+
TRANSPORT="${TRANSPORT:-launch}"
50+
# An empty VGI_RPC_SHM_SIZE_BYTES must not reach the C++ client (it would try to
51+
# attach a zero-size segment); only a real value enables the shm side channel.
52+
[ -n "${VGI_RPC_SHM_SIZE_BYTES:-}" ] || unset VGI_RPC_SHM_SIZE_BYTES
53+
54+
case "$TRANSPORT" in
55+
launch)
56+
# VGI_TEST_DEDICATED_WORKER is a plain (non-pooled) worker for the crash/
57+
# pool-recovery tests; the three wrappers route the one binary into the
58+
# versioned / versioned_tables / attach_options catalogs.
59+
export VGI_TEST_WORKER="launch:${VGI_WORKER_BIN}"
60+
export VGI_TEST_DEDICATED_WORKER="${VGI_WORKER_BIN}"
61+
export VGI_VERSIONED_WORKER="launch:${HERE}/wrappers/vgi-worker-versioned"
62+
export VGI_VERSIONED_TABLES_WORKER="launch:${HERE}/wrappers/vgi-worker-versioned-tables"
63+
export VGI_ATTACH_OPTIONS_WORKER="launch:${HERE}/wrappers/vgi-worker-attach-options"
64+
;;
65+
http)
66+
# Boot the example worker as an HTTP server on an ephemeral port; it prints
67+
# `PORT:<n>` once bound (same readiness contract as vgi-python's
68+
# vgi-fixture-http). For LOCAL use — NOT yet a CI lane: the Java worker's
69+
# HTTP transport has a known gap (table-function streaming, e.g.
70+
# `example.sequence(...)`, errors over http where vgi-python succeeds; the
71+
# haybarn runner's built-in `skip_error_messages HTTP` policy masks those as
72+
# skips, so the lane looks green while silently dropping ~table tests). Fix
73+
# the http streaming path before promoting this to the CI matrix. See
74+
# ci/README.md.
75+
HTTP_LOG="$(mktemp)"
76+
"$VGI_WORKER_BIN" --http --port 0 >"$HTTP_LOG" 2>&1 &
77+
HTTP_PID=$!
78+
trap '[ -n "${HTTP_PID:-}" ] && kill "$HTTP_PID" 2>/dev/null || true' EXIT
79+
PORT=""
80+
for _ in $(seq 1 60); do
81+
kill -0 "$HTTP_PID" 2>/dev/null || { echo "::error::http worker exited"; cat "$HTTP_LOG"; exit 1; }
82+
PORT="$(sed -n 's/.*PORT:\([0-9]*\).*/\1/p' "$HTTP_LOG" | head -1)"
83+
[ -n "$PORT" ] && break
84+
sleep 0.5
85+
done
86+
[ -n "$PORT" ] || { echo "::error::http worker never reported a port"; cat "$HTTP_LOG"; exit 1; }
87+
echo "HTTP worker on port $PORT (pid $HTTP_PID)"
88+
export VGI_TEST_WORKER="http://localhost:${PORT}"
89+
;;
90+
*)
91+
echo "::error::unknown TRANSPORT=$TRANSPORT (expected launch|http)"; exit 1 ;;
92+
esac
5293

5394
cd "$STAGE"
5495

0 commit comments

Comments
 (0)