Skip to content

JiT test suite#2185

Open
rafal-hawrylak wants to merge 8 commits into
mainfrom
pr5-jit-tests
Open

JiT test suite#2185
rafal-hawrylak wants to merge 8 commits into
mainfrom
pr5-jit-tests

Conversation

@rafal-hawrylak

@rafal-hawrylak rafal-hawrylak commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Part of #2110 - [Integrate JiT compilation into CLI]

@rafal-hawrylak rafal-hawrylak requested a review from a team as a code owner May 28, 2026 05:42
@rafal-hawrylak rafal-hawrylak requested review from zaptot and removed request for a team May 28, 2026 05:42
@rafal-hawrylak rafal-hawrylak removed the request for review from zaptot May 28, 2026 09:35
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 3 times, most recently from cb45fc7 to 05001ea Compare May 28, 2026 13:44
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 4 times, most recently from 30d827f to 82ea7e1 Compare June 20, 2026 12:28
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 2 times, most recently from ce6d2cd to d7b67c9 Compare June 22, 2026 10:11
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 5 times, most recently from c61b97b to 27ac555 Compare July 6, 2026 12:43
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 2 times, most recently from 80c6e77 to ad676e3 Compare July 13, 2026 14:40
@apilaskowski

Copy link
Copy Markdown
Collaborator

/gcbrun

@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 2 times, most recently from c38c043 to e417060 Compare July 15, 2026 12:06
Comment thread cli/api/commands/run.ts Outdated
Comment thread cli/api/commands/run.ts Outdated
@rafal-hawrylak rafal-hawrylak force-pushed the pr5-jit-tests branch 2 times, most recently from d360c39 to c4a4012 Compare July 15, 2026 19:56
- base_worker: drop redundant undefined guard around clearTimeout
  (clearTimeout(undefined) is a documented no-op). Restore
  runWorker's timeoutMillis to a required number and drop the
  conditional setTimeout — matches main's contract; the earlier
  loosening to number|undefined let JiT workers run without any
  timeout when --jit-timeout was omitted.
- jit/compiler.ts: default timeoutMillis to
  DEFAULT_COMPILATION_TIMEOUT_MILLIS at the .compile() entry point
  (mirrors CompileChildProcess.compile), so JiT workers always
  have a timeout even without --jit-timeout.
- build.ts: replace unsafe (action as any).jitCode cast with a
  narrowing "jitCode" in action check.
- run.ts: flatten the outer try/catch that only wrapped the JiT-compile
  try; the JiT-compile block already has its own try/catch. Extract the
  action.tableType -> dataform.TableType mapping into tableTypeEnum.
- constants.ts: revert DEFAULT_COMPILATION_TIMEOUT_MILLIS to 60000
  (main's value); the per-JiT timeout is configurable via
  --jit-timeout.
- compiler.ts: keep the Array.from(response) conversion (child.send
  uses JSON IPC by default, which serializes Uint8Array as
  {"0":n,...} and Buffer.from() rejects that) but add a comment
  documenting the constraint.
Each JiT compile registered a cancel handler on the Runner's EventEmitter
but never removed it once the compile finished. A run with N JiT actions
therefore accumulated N stale listeners and eventually tripped the default
MaxListenersExceededWarning threshold.

Register the handler through a local variable and remove it in a finally
block so successful and failed compiles both clean up. Also drops a stray
trailing-whitespace line from the dryRun compiledSql branch (comment #2).
Runs 4 JiT actions and asserts the CANCEL_EVENT listener count returns
to zero after the run completes. Fails today (leaks 4 listeners) — will
pass once run.ts unregisters each per-compile cancel handler.
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