-
Notifications
You must be signed in to change notification settings - Fork 0
Dotnet Background Processing
Akshay B edited this page Mar 16, 2026
·
2 revisions
This document details asynchronous background processing in PluckIt.Functions.
- Audience: external contributors
- Last reviewed: 2026-03-16
- Scope: queue and timer contracts only
- Trigger:
ProcessImageJobqueue function - Queue name:
image-processing-jobs - Input message:
ImageProcessingMessage - Workflow:
- Idempotency check (
DraftStatus == Processing) - Download raw blob
- Optional segmentation path:
- If
skip_segmentationis true, upload archive directly - Else call Python processor endpoint
/api/process-image
- If
- Parse processor result and persist draft terminal state
- Extract clothing metadata from processed image
- Write
DraftStatus.ReadyorFailedwith error text
- Idempotency check (
- Trigger:
0 0 3 * * *(03:00 UTC) - Behavior:
- Mark stale
Processingdrafts older than 2 hours asFailed - Purge old
Faileddrafts older than 7 days - Also performs related blob cleanup
- Mark stale
- Failure mode:
ProcessImageJoberror before final draft write- Expected outcome: draft transitions to
DraftStatus.FailedwithErrorTextpopulated, or remains retriable on re-invocation - Retry/alert: call
POST /api/wardrobe/drafts/{id}/retry; track retry counts and alarm on sustainedFailedspikes
- Expected outcome: draft transitions to
- Failure mode: queue message consumed while host restarts mid-processing
- Expected outcome: message can be retried; idempotency guard prevents duplicate finalization when
DraftStatus != Processing - Retry/alert: check queue depth and dead-letter activity
- Expected outcome: message can be retried; idempotency guard prevents duplicate finalization when
- Failure mode:
CleanupAbandonedDraftsmiss at schedule window- Expected outcome: stale
Processingand staleFailedrecords remain until next successful timer run - Retry/alert: alert on cron drift and
LastSuccesslag > 25h
- Expected outcome: stale
- Failure mode: timer blocked by partial failures (blob/API cleanup errors)
- Expected outcome: cleanup of terminal states may be incomplete while visible to queries
- Retry/alert: rerun timer manually after dependency recovery and track failed blob deletion counts
- 2026-03-16: Implemented issue #59 in
ClothingMetadataServiceso invalid LLM category values from metadata extraction are now validated against an allowlist, with fallback toUncategorisedand warning logging.