Repository navigation
Open
Open
Copy link
Description
Description
Bulk uploads in Content Drive feel slow because the job that processes them waits to be picked up. The upload should start right away while keeping what the job gives us.
How it works today
POST /api/v1/assets/_bulkupload(BulkUploadResource) stages the files and submits aBulkUploadProcessorjob.- Workers in
JobQueueManagerAPIImpl.processJobs()polljobQueue.nextJob(). When the queue is empty each worker sleeps with an exponential backoff (calculateBackoffTime: 1s, 2s, 4s... capped at 30s). - Nothing wakes the workers when a job is created. After a quiet period a new upload waits up to ~30s per poll before it starts. Users report waits closer to a minute; the cause of the gap between the 30s cap and that report still needs measuring.
What the job gives us and must keep
- Persistence of the run, and survival across restarts
- Progress and completion reporting (
BulkUploadCompletionListener, system events) - Cancellation, and the retry policy
- Distribution across cluster nodes
Acceptance Criteria
Preliminary, to be refined:
- Measure the current submit-to-start latency on an idle server and record the baseline.
- On the node that accepted the upload, the job starts within ~1-2s of submission.
- Persistence, progress, cancellation, retry behavior and cluster distribution keep working.
- Idle polling load on the database does not grow meaningfully.
- Other queues (folder delete, folder duplicate, content import) keep working, and ideally get faster too.
Priority
Medium
Additional Context
Candidate directions, not decided:
- Wake local workers on job creation: replace the plain
Thread.sleepbackoff with a wait thatcreateJobcan signal. Fixes same-node submits for every queue, small change. - Wake other nodes: a PostgreSQL
LISTEN/NOTIFYor a system event, with the backoff kept as fallback. - Lower or configure the backoff cap: cheapest, but trades latency for more DB polling.
- Run small batches inline, job above a threshold: fastest for small uploads but splits the code path and loses the job's guarantees for those runs; least preferred.
Relevant code: JobQueueManagerAPIImpl (processJobs, calculateBackoffTime, MAX_EMPTY_QUEUE_COUNT), JobQueueConfigProducer (JOB_QUEUE_THREAD_POOL_SIZE), BulkUploadResource, BulkUploadProcessor.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsNew
Activity