Skip to content

[Bug] Symbol Conversion on suggestContinueAsNew event. #463

@AnushkaKulkarni

Description

@AnushkaKulkarni

What are you really trying to do?

Report a bug on handling a suggestContinueAsNew event reason.

Describe the bug

The following line handles a known enum value ("suggestContinueAsNewReasons") as a symbol.
from my workflow history:

  "eventType": "EVENT_TYPE_WORKFLOW_TASK_STARTED",
  "workflowTaskStartedEventAttributes": {
    "suggestContinueAsNew": true,
    "suggestContinueAsNewReasons": [
      "SUGGEST_CONTINUE_AS_NEW_REASON_TOO_MANY_HISTORY_EVENTS"
    ]
  }

  and immediately after that:

  "eventType": "EVENT_TYPE_WORKFLOW_TASK_FAILED",
  "workflowTaskFailedEventAttributes": {
    "failure": {
      "message": "undefined method 'to_i' for an instance of Symbol"
    }
  }

from the SDK: @suggest_continue_as_new_reasons = activation.suggest_continue_as_new_reasons.map(&:to_i)

This raises the following workflow task error:
Message: undefined method 'to_i' for an instance of Symbol
Stack Trace:

/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/internal/worker/workflow_instance.rb:183:in 'Google::Protobuf::RepeatedField#each'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/internal/worker/workflow_instance.rb:183:in 'Enumerable#collect'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/internal/worker/workflow_instance.rb:183:in 'Temporalio::Internal::Worker::WorkflowInstance#activate'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/workflow_executor/thread_pool.rb:163:in 'block in Temporalio::Worker::WorkflowExecutor::ThreadPool::Worker#activate'
/app/vendor/bundle/ruby/3.4.0/gems/timeout-0.6.1/lib/timeout.rb:296:in 'block in Timeout.timeout'
/app/vendor/bundle/ruby/3.4.0/gems/timeout-0.6.1/lib/timeout.rb:304:in 'Timeout.timeout'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/workflow_executor/thread_pool.rb:149:in 'Temporalio::Worker::WorkflowExecutor::ThreadPool::Worker#activate'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/workflow_executor/thread_pool.rb:124:in 'block in Temporalio::Worker::WorkflowExecutor::ThreadPool::Worker#run'
<internal:kernel>:168:in 'Kernel#loop'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/workflow_executor/thread_pool.rb:115:in 'Temporalio::Worker::WorkflowExecutor::ThreadPool::Worker#run'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/workflow_executor/thread_pool.rb:99:in 'block in Temporalio::Worker::WorkflowExecutor::ThreadPool::Worker#initialize'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/thread_pool.rb:200:in 'block (3 levels) in Temporalio::Worker::ThreadPool::Worker#initialize'
<internal:kernel>:168:in 'Kernel#loop'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/thread_pool.rb:193:in 'block (2 levels) in Temporalio::Worker::ThreadPool::Worker#initialize'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/thread_pool.rb:192:in 'Kernel#catch'
/app/vendor/bundle/ruby/3.4.0/gems/temporalio-1.4.0-aarch64-linux/lib/temporalio/worker/thread_pool.rb:192:in 'block in Temporalio::Worker::ThreadPool::Worker#initialize'

Minimal Reproduction

  • Call a simple activity in a workflow 5000 times (ok if in parallel) to trigger a suggestContinueAsNew event

Environment/Versions

Causes a stuck workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions