Skip to content

Loop in approve() Function #159

Closed
Closed
@jasondalycan

Description

@jasondalycan

I have a workflow that has two cyclic paths (which River supports as per the documentation) but when invoking the approve(as_user, next_stage_id) function the database is queries in an infinite loop causing lock wait timeouts and the application comes to a halt. I've looked through the code and have identified the culprit function to be _re_create_cycled_path() within instanceworkflowobject.py where it loops infinitely within the while old_transitions: loop. It appears that the loop continuously creates cycle_transitions dynamically and then loops through them indefinitely declaring them as old_transitions.

I've implemented a patch whereby I end the loop once it begins looping through the cycle_transitions. Can you please confirm if this is indeed a bug (or a workflow pattern unsupported by River at this time and if it is a bug I can contribute the patch I've developed as needed.

Attached is a diagram of the workflow I have created (I've obfuscated some of the step names although they are all unique stages and not duplicates):

workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions