Repository navigation
world-postgres: make graphile-worker pollInterval configurable - #4355
Conversation
🦋 Changeset detectedLatest commit: 3b6094a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@cwdx is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
@cwdx Commits must have a verified signature for me to merge this. Please address |
Add pollInterval to PostgresWorldConfig and read WORKFLOW_POSTGRES_POLL_INTERVAL_MS in createWorld, matching the existing WORKFLOW_POSTGRES_WORKER_CONCURRENCY pattern. queue.ts now uses config.pollInterval ?? 500 instead of a hardcoded 500ms, so deployments can trade job-pickup latency for idle Postgres load. Default behavior is unchanged. Each of the queueConcurrency workers polls independently at this interval when idle; LISTEN/NOTIFY does not replace that polling, only wakes a worker sooner for a newly enqueued job. Closes vercel#4354 Signed-off-by: Chris Wijnia <ccwijnia@gmail.com>
…erval Signed-off-by: Chris Wijnia <ccwijnia@gmail.com>
50f1f21 to
3b6094a
Compare
|
Thanks! Both commits are now SSH-signed (Verified) and signed off, and DCO passes. I rebased onto the main commit you had merged, so the code is unchanged. The remaining red checks are the Vercel deploys that need team authorization for my fork. |
|
Backport to This is usually an infrastructure problem (e.g. the configured AI model could not be found, an AI Gateway error, or an opencode crash) rather than a merge conflict. Check the job logs linked above for details. Once the underlying issue is fixed, re-run the Backport to stable workflow manually via |
What
@workflow/world-postgreshardcodes graphile-worker'spollInterval: 500. This adds apollIntervaloption andWORKFLOW_POSTGRES_POLL_INTERVAL_MSenv var, same pattern asqueueConcurrency/WORKFLOW_POSTGRES_WORKER_CONCURRENCY. Default is unchanged.Why
Each concurrency slot polls on its own, so an idle World runs about
queueConcurrency × 2job-fetchUPDATEs per second. Withlog_statement = modevery idle poll lands in the Postgres log. LoweringqueueConcurrencyisn't a safe fix because it also caps parallel steps and can deadlock parent→child polling. This knob trades pickup latency for idle DB load instead.Changes
config.ts/index.ts: newpollIntervaloption read fromWORKFLOW_POSTGRES_POLL_INTERVAL_MS. The existing max-pool-size parser is generalized togetPositiveIntEnv(name)and used for both.queue.ts:pollInterval: config.pollInterval ?? 500.configuration/worlds.mdx,worlds/v5/postgres.mdx) document the option and env var.Testing
tsc --noEmitpasses. The world-postgres unit tests pass (41/41). Integration tests (testcontainers) were not run.Closes #4354