Repository navigation
feat(job): configure the jobs tick route's batch size, timeout and queues - #4524
Conversation
…eues The /wheels/jobs/tick route ran JobRunner.tick() with its defaults, so each call ran at most one job and nothing could raise that. It now passes three settings through: jobsRunnerTickMaxJobs (default 1), jobsRunnerTickTimeout (default 300) and jobsRunnerTickQueues (default every queue). The defaults keep today's behaviour. They are settings rather than request parameters, so a caller holding the token can't widen the work one request does; an invalid value falls back to its default. Documented in the multi-server jobs guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
|
REQUEST CHANGES at 5742398.
The source correctly reads these arguments from application settings only: |
…number ranges jobsRunnerTickMaxJobs takes a whole number from 1 to 1000 and jobsRunnerTickTimeout one from 1 to 86400; a fractional, out-of-range or non-numeric value falls back to the default instead of being truncated (0.5 became 0) or passed through past the INTEGER columns it reaches. The guide says a batch must fit inside the engine's request timeout, which the setting doesn't extend, and that a request killed mid-job leaves the job for the reaper to recover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
…numbers IsNumeric() accepts exponent notation, and Val() reads only a numeric prefix, so "1e3" became 1. A setting now has to read as plain digits (an engine's ".0" tail allowed); anything else, including "1e3", "1e99" and a leading sign, falls back to the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
|
Source APPROVE at 63b9c77. The settings now require plain whole-number syntax and enforce the documented ranges before they reach the runner. The added cases cover fractional, out-of-range, exponent, signed, invalid and complex values, with defaults preserved. The guide also explains the containing HTTP request budget and recovery/idempotency requirements. Both review findings are resolved; final approval remains pending the matrix and PR CI. |
Wheels Test Results74 285 tests 72 937 ✅ 27m 12s ⏱️ Results for commit 63b9c77. |
|
Final APPROVE at 63b9c77. Audited all 32 raw JVM results from full matrix 37889345954 and all 10 from final-head narrowed matrix 37890779947: 596 bundles per leg, zero failures/errors. JobTickEndpointSpec passed all 15 cases on the baseline and all 16 on every final-head leg, including the numeric validation boundaries and the authenticated three-job drain; none skipped. Final-head RustCFML reports 7256 passed, zero failures/errors, with its baseline comparison and matrix gate successful. PR CI: 32 passed, 2 skipped, no failures or pending checks, including successful LuCLI and CLI test jobs. Both review findings are resolved. |
Closes #4520
Problem
The
/wheels/jobs/tickroute calledJobRunner.tick()with no arguments, so every call ran at most one job, capped at 300 s, from any queue. Nothing could raise that. A scheduler hitting the route once a minute drained about one job a minute per server.Change
JobTickEndpoint.$runTick()now passes three app settings through totick(), read by a new$tickArguments():jobsRunnerTickMaxJobs1jobsRunnerTickTimeout300jobsRunnerTickQueues""""means every queueDefaults unchanged: the defaults are set in
onapplicationstartand match today's behaviour.Invalid values: a missing value, or one that is fractional, out of range, not a number, or a non-string queue list, falls back to its default. Values are never truncated:
Int()is never applied, because Lucee truncates it to 32 bits.Settings, not request parameters, so a caller holding the token can't widen the work one request does.
Docs: the multi-server jobs guide's tick-route section documents the settings and their ranges, and explains:
wheels jobs work;interruptedif the job isn't idempotent.A changelog fragment is included.
Tests
JobTickEndpointSpechas three new specs:tick(), checked on a stub runner's call log;tick()gets 1, 300 and every queue;jobsRunnerTickMaxJobs = 3, a real request throughhandle()drains three enqueued jobs in one call.Local results (jobs suite, 288 specs each):
Other checks:
pnpm build, 854 pages), and the page renders the new settings.verify-docson the page: 13 of 13 blocks pass.🤖 Generated with Claude Code