feat: per-domain rate limiting for the document pipeline #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/per-domain-rate-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Throttles outbound fetches per host:port so a small self-hosted or VPS
target is not hammered. A Postgres GCRA token bucket (host_throttle, one
row per host) is shared across worker replicas; a new gate step reserves
a slot and reschedules the fetch with GoTo::Delay instead of sleeping, so
no worker slot is held while waiting.
On 429/503 the host is backed off and the job's own run_at is pushed
(honoring Retry-After, otherwise exponential backoff), both with jitter
to avoid stampedes when many requests share a deadline. Stale
host_throttle rows are pruned hourly by a standalone maintenance job.
The pipeline namespace is bumped to v2 because a step was inserted:
apalis dispatches stepped jobs by index, so in-flight jobs from the old
shape must drain (re-enqueue) rather than run under the new chain.
WORKER_CONCURRENCY default raised 2 -> 8 so per-host pacing does not
starve other hosts.
22cd15cd1etod63f7d1732c77edf4272to42380de32bA job's name now opens /jobs/:id — full detail with payload/output JSON blocks, per-run attempts (durations, errors) and log lines, requeue on dead jobs, polling while live. A new Flow column and /flows/:flowId page give a document-independent view of any pipeline (clickable DAG, node table, retry), backed by a new GET /api/admin/flows/{flow_id}. DAG nodes navigate to the job detail from both the flow and document pages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>8607a7a06ctoee097b5a71