You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Queued train-predict forecasting jobs can cross database session boundaries with ORM-backed state attached to the TrainPredictPipeline instance.
This was discussed in #2034, where the immediate symptom was that the forecaster DataSource was not committed before the worker tried to load it. A related issue appeared after committing: ORM-backed sensors and regressors could become expired or detached before RQ serialized/executed the job.
It changes queued train-predict cycle jobs to pass serialized config/parameters plus data_source_id.
It reconstructs the pipeline inside the worker and loads sensors/data source through the worker's active DB session.
It adds regression coverage that queued job kwargs do not contain ORM instances.
Desired outcome
Queued forecasting jobs should not pickle or transport session-bound SQLAlchemy objects between the web/API process and worker process.
RQ payloads should remain plain, serializable data, and workers should load ORM objects within their own active DB session.
Acceptance criteria
Forecast jobs triggered through the API can be enqueued and executed without detached DataSource, target sensor, save sensor, or regressor sensor failures.
RQ cycle job kwargs contain no ORM model instances.
Worker-side pipeline execution loads all required ORM objects through the worker DB session.
Regression tests cover the queued-job payload shape and async forecasting path.
Problem
Queued train-predict forecasting jobs can cross database session boundaries with ORM-backed state attached to the
TrainPredictPipelineinstance.This was discussed in #2034, where the immediate symptom was that the forecaster
DataSourcewas not committed before the worker tried to load it. A related issue appeared after committing: ORM-backed sensors and regressors could become expired or detached before RQ serialized/executed the job.Related history
Fix detached DataSource and expired sensors when enqueuing forecast jobs #2034 investigated the detached
DataSource/ expired sensor problem.db.session.merge()/ refresh-style handling.Fix/small forecasting pipeline fixes #2011 merged the first/simple fix.
data_source not in databasefailure, but did not fully address the deeper issue of queueing ORM-backed pipeline state.Fix/detached forecasting sensors #2035 proposes the deeper fix.
data_source_id.Desired outcome
Queued forecasting jobs should not pickle or transport session-bound SQLAlchemy objects between the web/API process and worker process.
RQ payloads should remain plain, serializable data, and workers should load ORM objects within their own active DB session.
Acceptance criteria
DataSource, target sensor, save sensor, or regressor sensor failures.