Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

decision_context not set during signal-induced DecisionTask #110

Description

@ben-mays

Running the sample code given with a reference to the decision_context causes the DecisionTask to fail. The execution history shows DecisionTaskScheduled, DecisionTaskStarted but never DecisionTaskCompleted. Eventually the workflow will timeout. The cause is the decision_context resolving to nil.

Here is the modified code to reproduce:

require_relative '../../recipe_activities'
class WaitForSignalWorkflow
  extend AWS::Flow::Workflows

  workflow :place_order do
    {
      version: "1.0",
      task_list: "wait_for_signal_workflow",
      execution_start_to_close_timeout: 60,
      task_start_to_close_timeout: 20,
    }
  end
  activity_client(:client) { { from_class: "RecipeActivity" } }
  signal :change_order

  def initialize
    @change_order_period = 30
    @signal_received = Future.new
  end

  def place_order(original_amount)
    timer = create_timer_async(@change_order_period)
    wait_for_any(timer, @signal_received)
    client.process(amount)
  end

  def change_order(amount)
    puts workflow_id # raises exception, workflow_id calls decision_context.workflow_context..
    @signal_received.set(amount) unless @signal_received.set?
  end
end

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