Commit graph

23 commits

Author SHA1 Message Date
Yoan Bozhilov
3f3f9c6464 fix(taskprocessing): guard lockTask on scheduled, record started_at, Oracle fallback
Address review feedback (@marcelklehr, Copilot):
- lockTask claims only SCHEDULED tasks (was status != RUNNING) and stamps
  started_at in the same atomic UPDATE, so a finished task cannot be re-claimed
  and the external-provider claim path records started_at as well.
- claimWithBoundedRetry re-reads after lockTask instead of a follow-up UPDATE.
- Oracle joins SQLite on the bounded-retry fallback: Oracle cannot combine a
  row-limiting clause with FOR UPDATE (ORA-02014), which failed the claim tests
  on Oracle CI.
- Reword the worker docblock/comments to "prefer oldest available" (parallel
  SKIP LOCKED does not guarantee a strict global order).
- Add a regression test that lockTask does not resurrect a finished task.

Signed-off-by: Yoan Bozhilov <bygadd@gmail.com>
Assisted-by: Claude Code:claude-opus-4-8
2026-06-17 19:00:53 +02:00
Marcel Klehr
440d8e7a27 fix: Address review comments
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2026-06-17 19:00:53 +02:00
Yoan Bozhilov
aa5f45cecd fix(taskprocessing): claim tasks atomically with SKIP LOCKED + composite index
Replace the worker retry/ignore-list claim-loop with a single atomic
SELECT ... FOR UPDATE SKIP LOCKED claim (SQLite bounded-retry fallback),
preserving the no-duplicate guarantee while removing the thundering-herd
contention that throttled backlog draining. Add a (status,type,last_updated)
index via the table-creating migration + db:add-missing-indices listener.

Signed-off-by: Yoan Bozhilov <bygadd@gmail.com>
Assisted-by: Claude Code:claude-opus-4-8
2026-06-17 19:00:53 +02:00
Ferdinand Thiessen
e0ba4d71b6
chore: add missing Override attribute to OC
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 21:29:27 +02:00
Oleksander Piskun
f573285040 feat(taskprocessing): Add queue_stats API endpoint for external autoscalers
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
2026-03-30 12:03:19 +00:00
Marcel Klehr
6a1501a7d6 fix: address review comments
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-20 15:59:25 +02:00
Marcel Klehr
044e92bf4e feat(TaskProcessing): Introduce ITriggerableProvider
Signed-off-by: Marcel Klehr <mklehr@gmx.net>

# Conflicts:
#	lib/private/TaskProcessing/Db/TaskMapper.php
2025-10-20 15:59:25 +02:00
Marcel Klehr
16da8bbc8a fix(TaskProcessingApiController): Implement getNextScheduledTasks for next_batch endpoint
in order to avoid hitting the DB with multiple 1 row requests

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2025-10-14 11:50:29 +02:00
Julien Veyssier
222b19b805
feat(taskprocessing): rename cleanup column to allow_cleanup
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:22 +02:00
Julien Veyssier
19801f7ec4
feat(taskprocessing): move cleanup method to private taskprocessing manager, use it in the cleanup bg job and implement a cleanup command
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:21 +02:00
Julien Veyssier
8c52b6c0fe
feat(taskprocessing): add cleanup flag to tasks to decide if they should be cleaned up automatically
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-07 15:12:21 +02:00
provokateurin
2c65d0c0d1
fix(QBMapper): Fix findEntities() return type to be list<T>
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-11-06 16:31:39 +01:00
Julien Veyssier
c004f5376f
fix(taskprocessing): build autoloader files and fix psalm issue
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-07-23 17:12:38 +02:00
Julien Veyssier
df11aa9efc
feat(taskprocessing): add appId filter to taskprocessing occ commands
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-07-23 17:12:38 +02:00
Julien Veyssier
c120a64ba2
feat(taskprocessing): add occ commands to list tasks and compute stats
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2024-07-23 17:12:38 +02:00
Joas Schilling
eeb6ddb176
fix(db): Deprecate IExpressionBuilder::or() and IExpressionBuilder::and() without parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:16 +02:00
provokateurin
f5ff8136ac
feat(TaskProcessingApi): Add endpoint for getting the next task
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-07-01 17:11:12 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Marcel Klehr
a8afa7f23d fix(OCS-API): Add endpoint to list user tasks
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-14 11:38:41 +02:00
Marcel Klehr
4a3b9b826e refactor: identifier is now customId/custom_id
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-14 11:38:41 +02:00
Marcel Klehr
7a947980db fix: Fix psalm issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-14 11:38:39 +02:00
Marcel Klehr
4b2acee64b test: Add OldTasksShouldBeCleanedUp test
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-14 11:38:39 +02:00
Marcel Klehr
00894e2420 feat: first pass at TaskProcessing API
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2024-05-14 11:38:39 +02:00