Background workers#83
Open
Yannicked wants to merge 39 commits into
Open
Conversation
06bf048 to
68938a1
Compare
Merged
…3 chain complete_ingestion_task opened a DB session via get_db() but never closed it, leaking a connection on every ingestion (it is the terminal task of the v1.3 chain). Wrap its body in try/finally so the session is always closed, matching copy_files_task and validate_imas_task. validate_imas_task was a stub that always set VALIDATED without validating, and the v1.3 ingestion chain never ran it, so v1.3 silently ignored validation.auto_validate / error_on_fail that v1/v1.1/v1.2 honor. The task now runs the same schema Validator v1.2 uses, sets VALIDATION_FAILED and (when error_on_fail) re-raises to abort the chain before COMPLETED. The v1.3 endpoint inserts the validation step into the chain when auto_validate is set.
to_model_with_path passed the SQLAlchemy URI TypeDecorator (imported from .types) to sha1_checksum instead of a simdb.uri.URI, so sha1_checksum raised AttributeError on uri.scheme for any IMAS file. Construct the URI via the urilib.URI parser, matching from_data / from_data_model.
…n in v1.3 chain" This reverts commit e31729c.
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.
This PR introduces simulation ingestion via Celery background workers.
When simulations are uploaded through the new v1.3 API endpoint, file copying and status tracking are now handled by Celery tasks (copy_files_task chained with complete_ingestion_task) rather than blocking the HTTP request.
The ingestion pipeline tracks status though the following: QUEUED → COPYING → COPIED → VALIDATING → VALIDATED → COMPLETED, with failure variants.