Skip to content

Commit

Permalink
Fix cardinality violation error: subquery returns multiple results
Browse files Browse the repository at this point in the history
Do not use scalary subquery, delete all selected jobs instead
  • Loading branch information
jdavcs committed Dec 21, 2023
1 parent 0887ec9 commit c8012df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8293,9 +8293,8 @@ def cancel_invocation_steps(self):
.filter(WorkflowInvocationStep.workflow_invocation_id == self.id)
.filter(~Job.state.in_(Job.finished_states))
.with_for_update()
.scalar_subquery()
)
sa_session.execute(update(Job.table).where(Job.id == job_subq).values({"state": Job.states.DELETING}))
sa_session.execute(update(Job.table).where(Job.id.in_(job_subq)).values({"state": Job.states.DELETING}))

job_collection_subq = (
select(Job.id)
Expand Down

0 comments on commit c8012df

Please sign in to comment.