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
{{ message }}
Repository navigation
MultiBackendJobManager: avoid mixing openEO job status and internal status in same column #840
MultiBackendJobManager involves a status column which is used for
official openEO status, e.g. "created", "queued", "running", "finished", ...
internal housekeeping e.g. "not_started", "queued_for_start"
Mixing both has popped up quite often as a source of confusion during MultiBackendJobManager feature requests, bug fixes, and attempts to improve test coverage (especially when we started to do things in threads and the order of execution stopped being deterministic)
the official job status and internal status should be separated
in 706fafe I naively wanted to stop counting "created" jobs as "running", which sounded reasonable, but then a bunch of MultiBackendJobManager unit tests became flaky
However I do believe that this should be internal cuisine and hidden from the user.
These days they build color-map tools based on the dataframe which look at the single status column.
So I would propose to tackle this in the database only if possible
_column_requirements = _ColumnRequirements({
# Official openEO backend status (from API calls)
"backend_status": _ColumnProperties(dtype="str", default=None), -->"created", "queued", "running", "finished", "error", "canceled"
# keep status with all non official states
"status": _ColumnProperties(dtype="str", default="not_started"), --> "not_started", "created", "queued_for_start", "queued" "start_failed", "skipped", "running", finished, error, "downloading"
Then in the code internally we can work and act upon the backend status where needed?
Currently too early for a PR; but maybe good to spur the discussion? While it does resolve some of this issues; I do sense it adds a layer of complexity to have multiple statuses per job in various columns....
I think that this issue tries to reduce the complexity for developers for future changes to the job manager. I think however that introducing a new column creates new complexity for the users instead.
I see some users creating maps/summaries of their job_db's, who would now have to look at two different columns, which might become confusing.
What I think we need is clear documentation of which statuses exist, what the possible flows are and some checks on these.
One example is the recent bug where queued_for_start was being overwritten by the created status in the backend. This could also be the cause of the tests becoming flaky when stopping counting created as running.
A concrete proposal from my end is to consider the job manager statusses as "sub-statusses", where each job manager status corresponds to one single possible backend status.
not_started -> no backend status as job is not created yet (once again an ambiguous name)
created -> created
queued_for_start -> created
queued -> queued
start_failed -> created
skipped -> no status
running -> running
finished -> finished
downloading -> finished
error -> error
The mapping as a hidden contract, is probably more fragile than an explicit column. Furthermore the second column gets its status explicitly from the backend; independent of any assumption done in the mapping
Important to note; the status column would not change. So we would remain backwards compatible.
nevertheless; I agree that more columns to the database does benefit the users. We already have an issue here with start time and running start time. The information is really helpful if you know what you are doing, but when you are new; it complicates the matter.
I might also be wrong here, but while testing the MultiBackendJobManager, I noticed that sometimes a job gets "stuck" in the created stage. I guess this could happen whenever the request between creating the job and actually starting it might go wrong? However, looking at the code, I get the impression that the created status is considered to be a "running" status, which means that the batch job manager is not retrying if it got stuck there.
Activity
soxofaan commentedon Dec 17, 2025
example of last incident: #839 (comment)
in 706fafe I naively wanted to stop counting "created" jobs as "running", which sounded reasonable, but then a bunch of MultiBackendJobManager unit tests became flaky
Revert 706faf and 3d3ca1 for #839/#840
soxofaan commentedon Dec 17, 2025
cc @HansVRP
HansVRP commentedon Dec 19, 2025
Indeed, let's put it higher on the agenda.
However I do believe that this should be internal cuisine and hidden from the user.
These days they build color-map tools based on the dataframe which look at the single status column.
So I would propose to tackle this in the database only if possible
Revert 706faf and 3d3ca1 for #839/#840
HansVRP commentedon Dec 22, 2025
Then in the code internally we can work and act upon the backend status where needed?
soxofaan commentedon Jan 5, 2026
but what kind of status values do they expect there? Official openEO job statuses or do they also support these ad-hoc internal statuses?
HansVRP commentedon Jan 6, 2026
also their adhoc statuses (e.g. a downloading status)
soxofaan commentedon Mar 23, 2026
Another case of wrestling with the mixed up status field:
cc @VictorVerhaert
HansVRP commentedon Mar 24, 2026
Sketched out a first solution where the status column remains unchanged, but we do introduce a column with only pure back-end statuses.
openeo-python-client/openeo/extra/job_management/_manager.py
Line 201 in 8bc4ac8
By allowing get_by_status to select either column
openeo-python-client/openeo/extra/job_management/_job_db.py
Line 73 in 8bc4ac8
we can selectively pick jobs with a certain back-end status and still act upon their job_manager status
openeo-python-client/openeo/extra/job_management/_manager.py
Line 845 in 8bc4ac8
Currently too early for a PR; but maybe good to spur the discussion? While it does resolve some of this issues; I do sense it adds a layer of complexity to have multiple statuses per job in various columns....
VictorVerhaert commentedon Mar 25, 2026
I think that this issue tries to reduce the complexity for developers for future changes to the job manager. I think however that introducing a new column creates new complexity for the users instead.
I see some users creating maps/summaries of their job_db's, who would now have to look at two different columns, which might become confusing.
What I think we need is clear documentation of which statuses exist, what the possible flows are and some checks on these.
One example is the recent bug where queued_for_start was being overwritten by the created status in the backend. This could also be the cause of the tests becoming flaky when stopping counting created as running.
A concrete proposal from my end is to consider the job manager statusses as "sub-statusses", where each job manager status corresponds to one single possible backend status.
These should be checked in the _track_statusses
HansVRP commentedon Mar 27, 2026
The mapping as a hidden contract, is probably more fragile than an explicit column. Furthermore the second column gets its status explicitly from the backend; independent of any assumption done in the mapping
Important to note; the status column would not change. So we would remain backwards compatible.
nevertheless; I agree that more columns to the database does benefit the users. We already have an issue here with start time and running start time. The information is really helpful if you know what you are doing, but when you are new; it complicates the matter.
HansVRP commentedon Mar 27, 2026
I believe the discussion is moving into another direction: #877
JanssenBrm commentedon Jul 12, 2026
I might also be wrong here, but while testing the MultiBackendJobManager, I noticed that sometimes a job gets "stuck" in the created stage. I guess this could happen whenever the request between creating the job and actually starting it might go wrong? However, looking at the code, I get the impression that the created status is considered to be a "running" status, which means that the batch job manager is not retrying if it got stuck there.
HansVRP commentedon Jul 13, 2026
if starting the job, fails, it should go to the start_failed status. Curious to see where this does not occur