-
Notifications
You must be signed in to change notification settings - Fork 5
Comparing changes
Open a pull request
base repository: utopia-php/queue
base: main
head repository: utopia-php/queue
compare: feat/queue-keda
- 10 commits
- 14 files changed
- 2 contributors
Commits on Jul 14, 2026
-
feat(queue): KEDA ScaledJob POC — payload stays in Redis
Alternative to the env-var KubernetesJob broker: instead of inlining the payload in a per-message Job, producers enqueue to the ordinary Redis broker and a KEDA ScaledJob scales one-shot worker Jobs off the queue depth. Each worker drains the queue with the same Redis broker and exits — no custom broker, no payload on any Kubernetes object. Adds a drain worker, Dockerfile, redis + ScaledJob manifests, a kubectl-driven e2e (KedaTest) proving KEDA spawns Jobs that drain the queue, and keda-e2e.sh (kind + KEDA + redis). Verified end-to-end on kind. See servers/Keda/README.md for the comparison. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6c94dee - Browse repository at this point
Copy the full SHA 6c94deeView commit details -
test(queue): run the KEDA e2e in CI via a shared keda-lib.sh
Factor the kind + KEDA + Redis + ScaledJob provisioning into tests/keda-lib.sh (keda_up/keda_down) and have both keda-e2e.sh and the package's e2e.sh use it, so `bin/monorepo test queue` (and thus CI) stands up KEDA and runs KedaTest against a real cluster instead of skipping it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 00ff389 - Browse repository at this point
Copy the full SHA 00ff389View commit details -
test(queue): address review on the KEDA POC
- keda-lib.sh: pin + SHA-256-verify Helm (same as kind/kubectl) instead of curl|bash of an unpinned installer; only tear down a kind cluster this run created, never a pre-existing one. - KedaTest: also assert the .failed.* list is empty — draining the main queue alone doesn't prove success since receive() pops before handling; note that enqueue() mirrors Redis::enqueue()'s envelope. - k8s.yaml: correct the scaling comment (KEDA scales N Jobs, workers batch-drain) and document the backoffLimit/processing-orphan crash-recovery caveat. - README: crash-recovery section (processing-list reaper via Publisher::retry). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 97f307f - Browse repository at this point
Copy the full SHA 97f307fView commit details -
feat(queue): add Adapter\KubernetesJob (run-to-completion drain adapter)
The KEDA approach still needs one bit of library code: a consumer that drains the queue and exits (so a Job completes) instead of blocking like the Swoole/ Workerman adapters. Extract that out of the test worker into Utopia\Queue\Adapter\KubernetesJob, cover it with a bare-host unit test (KubernetesJobAdapterTest), and have the KEDA worker run it via Server. Producers are unchanged — they still enqueue with any Publisher (e.g. the Redis broker). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c0a79d - Browse repository at this point
Copy the full SHA 4c0a79dView commit details -
fix(queue): harden KubernetesJob run-to-completion adapter against po…
…d termination and boot failures Register pcntl SIGTERM/SIGINT handlers in the KubernetesJob consume loop so graceful pod termination drains the in-flight message instead of being SIGKILLed (PHP is PID 1 in the Job container, so an unhandled SIGTERM is ignored). Run the workerStart callbacks under try/finally so workerStop (Timer cleanup) always runs. Add runsToCompletion() to Adapter, overridden true in KubernetesJob, and rethrow boot/consume-loop failures from Server::start() for run-to-completion adapters so the Job fails (honouring backoffLimit) rather than exiting 0. Guard the Redis broker claim writes after the pop and requeue the payload on failure so a mid-claim error no longer strands the message. Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 66f25e3 - Browse repository at this point
Copy the full SHA 66f25e3View commit details -
fix(queue): install pcntl in the KEDA e2e worker image
Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6ad818e - Browse repository at this point
Copy the full SHA 6ad818eView commit details -
refactor(queue): Swoole-native signal handling in KubernetesJob
Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 81309cd - Browse repository at this point
Copy the full SHA 81309cdView commit details -
fix(queue): run the whole KubernetesJob lifecycle inside one scheduler
Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52b9c7d - Browse repository at this point
Copy the full SHA 52b9c7dView commit details -
revert(queue): drop requeue-on-failed-claim in the Redis broker
Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9a67396 - Browse repository at this point
Copy the full SHA 9a67396View commit details -
refactor(queue): fold single-use helpers into their call sites
Co-Authored-By: Claude Fable 5 <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8fa82ed - Browse repository at this point
Copy the full SHA 8fa82edView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...feat/queue-keda