Repository navigation
feat(task-queue): Procrastinate worker for the three Track 1 scheduled jobs - #588
Closed
aivong-openhands wants to merge 1 commit into
Closed
aivong-openhands wants to merge 1 commit into
aivong-openhands wants to merge 1 commit into
Conversation
Contributor
aivong-openhands
force-pushed
the
task-queue/02-procrastinate-schema
branch
from
September 30, 2026 06:14
c591712 to
c27fe11
Compare
aivong-openhands
force-pushed
the
task-queue/03-worker
branch
from
September 30, 2026 06:14
f049103 to
b64e3cb
Compare
aivong-openhands
force-pushed
the
task-queue/02-procrastinate-schema
branch
from
September 30, 2026 15:18
c27fe11 to
f8db211
Compare
1 of 6 tasks
aivong-openhands
force-pushed
the
task-queue/03-worker
branch
2 times, most recently
from
September 30, 2026 20:55
0f7e86c to
387acd8
Compare
…d jobs server/task_queue runs clean-app-conversation-start-tasks, clean-proactive-convo-table and enrich-user-interaction as Procrastinate periodic tasks. Each calls the job's existing main(). - Execution lock per job and no queueing_lock anywhere: Procrastinate keeps queueing_lock across a retry, which would collide with the next queued occurrence. - TASK_QUEUE_ROLE (business|ops) scopes periodic registration, because the deferrer reads the whole registry regardless of consumed queues. - TASK_QUEUE_SCHEDULING_ENABLED stops scheduling without changing what the worker consumes, so rollback can drain. - max_delay 26h app-wide; startup refuses a schedule whose gap the window does not cover, since a dropped occurrence is unrecoverable. - Cleanup occurrences superseded by a newer one are skipped and recorded; every occurrence logs executed/skipped_stale/failed. - Worker exits non-zero whenever it stops without a signal (database unreachable), shutdown_graceful_timeout left unset. - Refuses the Cloud SQL connector path (PRE-3) rather than bypass it. OHE-3417 (Track 1, T1.5, T1.6) Co-authored-by: openhands <openhands@all-hands.dev>
aivong-openhands
force-pushed
the
task-queue/03-worker
branch
from
September 30, 2026 21:59
387acd8 to
0f0e532
Compare
Contributor
Author
|
Closing: superseded by the revised CronJob migration plan for OHE-3417 (rev 16). That plan runs the scheduled jobs on the shared worker App from #601 instead of a separate business/ops App. It also uses a per-job queueing lock with no execution lock, and drops Procrastinate retries and the 26 h max_delay. The branch is kept for reference. Worth reusing in the new work: calling each job's existing main() lazily, the TASK_QUEUE__* env convention, outcome logging, and the real-Postgres / real-worker test harness. This comment was posted by an AI agent (OpenHands) on behalf of @aivong-openhands. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 3/7: OHE-3417 Track 1. Based on #587. Implements T1.5, T1.5.1 and T1.6: the task registry and
python -m server.task_queue.worker. The watchdog (#4 in the stack) and ops recovery (#5) come next.Change
server/task_queue/runsclean_app_conversation_start_tasks,clean_proactive_convo_tableandenrich_user_interaction_dataas Procrastinate periodic tasks. Each calls the job's existingmain()unchanged, imported lazily so a disabled job needs none of its configuration.lockper job, noqueueing_lockanywhereretry_job_v2setstodoand keepsqueueing_lock. The index is unique overtodo, so a retry would collide with the next queued occurrence.lockreproducesconcurrencyPolicy: ForbidTASK_QUEUE_ROLE=business|opsscopes periodic registration_periodic_deferrerreads the whole registry regardless of consumed queues. Without this, ops workers would schedule business jobs (#17)TASK_QUEUE_SCHEDULING_ENABLED, separate from rolemax_delay26 h app-wide; startup refuses a schedule whose gap the window does not covermax_delaydrops an occurrence before any task body runs, so nothing downstream can recover itexecuted/skipped_stale/failedexecutedonly (T1.11)shutdown_graceful_timeoutunsetaborted, and recovery never picks those upGCP_DB_INSTANCEDB_HOST) is unaffectedTASK_QUEUE_<JOB>_{ENABLED,SCHEDULE,BUDGET_SECONDS}server/constants.pyconventionTests (real Postgres, real worker)
Covers acceptance criteria #1, #2, #8, #9, #10, #17, #23 and #25:
max_delaywindow behaviour.This PR was created by an AI agent (OpenHands) on behalf of the user.
@aivong-openhands can click here to continue refining the PR
Enterprise server image for this PR: