Skip to content

WorkflowInstance.start() is not thread-safe #1802

Open

Description

@mathecruz

WorkflowMutableInstance#startExecution guards single-execution with a non-atomic check-then-act:

  future = futureRef.get();
  if (future == null) {
      future = runnable.get()...;   // starts task processing, fires WorkflowStartedEvent
      futureRef.set(future);
  }
  return future;

Two threads calling start() at the same time can both see futureRef.get() == null and both run the startup side effects before either set() wins.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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