Skip to content

fix: ignore task notifications for aborted/expired jobs(MAPCO-11121)#70

Merged
almog8k merged 2 commits into
masterfrom
fix/job-tracker-skip-terminated-job-notifications
Jul 15, 2026
Merged

fix: ignore task notifications for aborted/expired jobs(MAPCO-11121)#70
almog8k merged 2 commits into
masterfrom
fix/job-tracker-skip-terminated-job-notifications

Conversation

@almog8k

@almog8k almog8k commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
Question Answer
Bug fix
Tests added

Fixes a bug where a manually aborted ingestion update job could still reach and fail at the finalize task, with the polygon-parts processParts step erroring that the validation table doesn't exist.

Root cause: aborting a job only moves its currently-PENDING tasks to ABORTED — a task already IN_PROGRESS (e.g. a tiles-merging task mid-run) keeps running untouched, and the abort flow also deletes the layer's polygon-parts validation table. When that in-flight task later completes and notifies job-tracker, handleTaskNotification acted on it without checking the job's own status:

  • a completed notification let completedTasks === taskCount create the next task, including finalize — for a job that was already ABORTED.
  • a failed notification (e.g. finalize failing on the now-missing validation table) then overwrote the job status from ABORTED to FAILED, erasing the fact that it was ever aborted.

Fix: in TasksManager.handleTaskNotification, after fetching the job, short-circuit and log a warning if the job is already in a terminal state (ABORTED or EXPIRED) — skip both task-flow advancement and job status updates for that notification.

Changes

  • src/tasks/models/tasksManager.ts — skip notification handling when job.status is ABORTED or EXPIRED.
  • tests/unit/tasks/models/tasksManager.spec.ts — new Terminated Jobs cases:
    • completed task notification for an ABORTED job → no next task created, no job update.
    • failed task notification for an ABORTED job → job status not overwritten.
    • completed task notification for an EXPIRED job → no next task created, no job update.

@almog8k almog8k merged commit 73deff5 into master Jul 15, 2026
5 checks passed
@almog8k almog8k deleted the fix/job-tracker-skip-terminated-job-notifications branch July 15, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants