Skip to content

Java: Conductor creates a lag when recovering after a server crash #219

@tomasol

Description

@tomasol

As discussed in this discord thread, workflows get stuck if conductor is enabled.

Restarting the server while parent-serial is running leads to the workflow execution being stuck for more than 5 minutes, possibly forever.

Restarting parent-parallel leads to around a minute delay before the workflow is replayed. Disabling conductor removes those delays and both workflows replay immediately.

@Workflow(name = "parent-serial")
public void parentSerial() throws InterruptedException {
    System.out.println("parent-serial start");
    for (int i = 0; i < 10; i++) {
        final int i2 = i;
        DBOS.runStep(() -> taskWorkflow(i2), "step " + i);
    }
    System.out.println("parent-serial completed");
}

@Workflow(name = "parent-parallel")
public void parentParallel() throws InterruptedException {
    System.out.println("parent-parallel start");
    List<WorkflowHandle<Void, InterruptedException>> handles = new ArrayList<>();
    for (int i = 0; i < 10; i++) {
        final int index = i;
        WorkflowHandle<Void, InterruptedException> handle = DBOS.startWorkflow(
                () -> this.proxy.taskWorkflow(index),
                new StartWorkflowOptions().withQueue(this.queue));
        handles.add(handle);
    }
    for (WorkflowHandle<Void, InterruptedException> handle : handles) {
        try {
            handle.getResult();
        } catch (Exception e) {
            System.out.println("Task failed " + e);
        }
    }
    System.out.println("parent-parallel completed");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions