Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / module
jobs
codeintel.jobs
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| cancel | jobs.py | same file |
| claim | jobs.py | same file |
| classify_error | jobs.py | same file |
| default_worker_id | jobs.py | same file |
| heartbeat | jobs.py | same file |
| next_queued_ids | jobs.py | same file |
| queue_summary | jobs.py | same file |
| QueueFull | jobs.py | same file |
| recover_stale | jobs.py | same file |
| retry_delay_seconds | jobs.py | same file |
| run | jobs.py | same file |
| Submission | jobs.py | same file |
| submit | jobs.py | same file |
| utcnow | jobs.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| embeddings | embeddings.py | through an import |
| git_source | git_source.py | through an import |
| indexer | indexer.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| router | router.py | through an import |
codeintel.jobsbackend/app/codeintel/jobs.py, lines 1–40Open source
"""Durable ingestion jobs.PostgreSQL is the source of truth; Redis (optional) only carries wake-upnotifications. Consequences:* A lost notification never loses a job — workers also poll for queued jobs and re-notify on startup.* A duplicated notification never runs a job twice — :func:`claim` is an atomic conditional UPDATE (``WHERE status = 'queued'``).* A worker that dies mid-job leaves a ``running`` row with a stale heartbeat; :func:`recover_stale` puts it back in the queue (or fails it once attempts are exhausted).* Submitting a repository that already has an active job returns that job (``uq_ingestion_jobs_active``) instead of queueing a second clone.Every job ends in exactly one terminal state: ``succeeded``, ``failed`` or``cancelled``.The queue helpers (:func:`claim`, :func:`next_queued_ids`, :func:`heartbeat`,:func:`cancel`, :func:`queue_summary`, :func:`recover_stale`) take the jobmodel, so learning jobs (``LearningJob``) share this state machine."""from __future__ import annotationsimport loggingimport socketimport uuidfrom dataclasses import dataclassfrom datetime import UTC, datetime, timedeltafrom sqlalchemy import func, or_, select, updatefrom sqlalchemy.exc import IntegrityErrorfrom sqlalchemy.orm import Sessionfrom ..database.models import IngestionJob, LearningJob, Repositoryfrom .embeddings import Embedder, EmbeddingUnavailablefrom .git_source import GitError, RepoRef, RepoSpecErrorfrom .indexer import CodeIndexerShows the first 40 of 302 lines. The rest is on GitHub at this commit.
What the index recorded
- Signature
module backend.app.codeintel.jobs- File
backend/app/codeintel/jobs.py- Lines
- 1–302
- Parser
- python-ast
- Git blob
54c9a5d84ee5feda5176c3e05d0aa9a7d46f6016- Call sites
- 1 named, 0 resolved, 1 left unlinked
- Outside this subset
- 10 more edges reach code outside the graph shown here
