Skip to main content

Background jobs

DIAL Core runs several jobs beside request handling: it polls background Responses API jobs, sweeps the spend counters of withdrawn budgets, keeps the client channel used by toolset sign-in alive, and streams system exports. These static settings tune each job. This page is for platform engineers who operate Core at scale; the defaults suit most deployments.

Background Responses jobs​

Core polls a background Responses API job through its own HTTP endpoint, so polling requests pass through the interceptor chain.

SettingDefaultDescription
backgroundJob.localBaseUrlhttp://localhost:{actual server port}The base URL that polling uses to reach this Core instance.
backgroundJob.pollTimeoutMs300000The timeout of one polling request, in milliseconds. A request that exceeds it counts as a failed poll.
backgroundJob.pollGiveUpStatusCodes[401, 403, 404]Polling response codes that make the job give up at once instead of retrying.
backgroundJob.jobTtlMs86400000The lifetime of a job and of its per-request API key, in milliseconds. The next scan expires a job older than this.
backgroundJob.scanIntervalMs600000The time between scans of stored jobs, in milliseconds. A scan schedules each job for polling or expires it.

The bundled defaults also set initialPollIntervalMs (10000), maxPollIntervalMs (300000), pollBackoffFactor (2.0), maxSequentialPollFailures (10), leaseTimeoutMs (300000), maxParallelJobs (100), and schedulerTickIntervalMs (5000) under backgroundJob. The Core documentation does not describe them.

Budget counter sweep​

A periodic job deletes the spend counters of withdrawn budgets. A counter is removed once both of its windows have closed and no assignment or self-applying policy exists for its budget.

SettingDefaultDescription
budgetCounterSweep.period300000The time between sweeps, in milliseconds.
budgetCounterSweep.batch500The number of counters handled per sweep.

Client channel​

The client channel is a Server-Sent Events channel that relays JSON-RPC requests and responses between a toolset deployment and its subscribed client, for example during toolset sign-in. A watchdog checks that the underlying Redis pub/sub subscription is alive and resubscribes if Redis dropped it silently, for example when a NAT or load balancer killed an idle connection.

SettingDefaultDescription
clientChannel.watchdog.period10000The time between watchdog checks, in milliseconds.

System export​

POST /v1/admin/system-export streams the public and platform buckets as a ZIP archive; see Configuration API.

SettingDefaultDescription
adminSystemExport.stallTimeout60000How long the export waits for a slow client to take buffered data before it fails and resets the connection, in milliseconds. Raise it if clients on slow connections fail. It must be positive and below the 5-minute lock period (300000), or Core does not start.

Further reading​