Repository navigation
feat: move assignment reference-file extraction to the mark-jobs worker - #604
Open
NoahFreelove wants to merge 9 commits into
Open
NoahFreelove wants to merge 9 commits into
NoahFreelove wants to merge 9 commits into
Conversation
Registers mark.file-extract in the workerSpecs table with a dedicated handleFileExtractJob handler (concurrency 2, 5-min lock, maxStalledCount=0). Updates all spec assertions that enumerate exact worker counts (6→7) and adds local-routing + forward-routing coverage for the new queue.
…dget Extraction errors are deterministic and persist FAILED, but an S3 download error is infrastructure: rethrow it so the remaining BullMQ attempts recover instead of terminally failing the file. Also surface and rethrow a failure of the raw fallback update.
|
This pull request has had no activity for 30 days, so it has been marked |
This branch has not been deployed
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.
Summary
Author reference-file content extraction (pdf-parse / pdfjs+canvas — the CPU/RAM-heavy part of
completeAssignmentFileUpload) no longer runs on the mark-api request thread. The complete endpoint now finalizes S3, marks the rowstatus=READY/extractionStatus=PENDING, and enqueues a job on a newmark.file-extractBullMQ queue; the extraction half runs on the mark-jobs fleet viaAssignmentFileService.runAssignmentFileExtractionand persistsextractedText+ terminalREADY/FAILED.FileExtractJobPayload,QUEUE_METADATAentryassignment-file.service.ts; enqueue failure is tolerated (row staysPENDING, upload still succeeds)JobExecutorServicedispatches the queue; jobs app registers it through the declarativeworkerSpecstable:FILE_EXTRACT_CONCURRENCY(default 2), lockDuration 300s,maxStalledCount=0(poison-file OOM fails permanently instead of cascading to more pods)FILE_PROCESSING_BUDGET_BYTESon mark-jobs, commentedFILE_EXTRACT_CONCURRENCY, heavy-tier example updatedThis is backend-only: the v2 AssignmentFile pipeline has no frontend caller yet, and its sole server-side consumer (question generation) already reads only
extractionStatus=READYrows, so the sync→async contract change breaks no consumer.Behavior details
FAILEDterminally. The method is idempotent (fresh row load by id; single overwrite update).Deploy follow-up (apps-faculty-deploy, separate PR)
config/mark-jobs-heavy/values.yaml.gotmpl:JOB_WORKER_QUEUES: "mark.attempt.heavy,mark.file-extract", plusFILE_EXTRACT_CONCURRENCY: "2"andFILE_PROCESSING_BUDGET_BYTES: "1073741824"config/mark-jobs): unchanged — its explicit queue list must NOT gainmark.file-extractNotes for the deferred PENDING-row sweeper
removeOnFail: count 100) under jobIdextract:<fileId>; a lateraddwith the same jobId is silently deduplicated. The sweeper must remove the stale failed job first (or use a nonce jobId) or re-enqueues will silently no-op.PENDING— indistinguishable from never-enqueued. Fine while headless; add a failed-listener DB mark when the multipart UI lands.Testing
src/job-queue+ assignment v2 file suites — 144 passed (2 pre-existing environment skips)helm template(budget key renders;JOB_WORKER_QUEUESstays unset by default)