Action policy "action.concurrency.attr" doesn't respect default values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
SUMMARY
Action policy for attr doesn't respect when it has default values for the attribute.
STACKSTORM VERSION
Paste the output of st2 --version: st2 3.6.0, on Python 3.6.8
OS, environment, install method
OL7 all-in-one st2 server installed on bare VM
Steps to reproduce the problem
Created a simple local action with a default value of sleep 60 for the cmd
description: Action that executes an arbitrary Linux command on the localhost.
enabled: true
entry_point: ''
name: loop_test
parameters:
cmd:
description: Arbitrary Linux command to be executed on the remote host(s).
required: true
type: string
default: "sleep 60"
sudo:
immutable: true
runner_type: "local-shell-cmd"
Created an attr policy to cancel with a threshold of 2
name: "test my loop policy"
description: ""
enabled: true
resource_ref: "examples.loop_test"
policy_type: "action.concurrency.attr"
parameters:
action: "cancel"
threshold: 2
attributes:
- cmd
Execute the action three times without filling in the cmd attribute. All three will run without the third action being canceled.
Fill in cmd with sleep 30 or even the same default value of sleep 60. The third action will be properly canceled. (In the screenshot they are showing orange because of the 60 second action timeout)

Expected Results
Any action execution >2 with a default attribute should've been canceled
Actual Results
Any action execution >2 with a default attribute did not cancel
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the action.concurrency.attr policy with the loop_test action on StackStorm 3.6.0, using the YAML examples and omitting cmd so its default applies. Compare executions with an explicitly supplied cmd. Done means the third execution is canceled when the attribute uses its default value, just as it is when cmd is supplied.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100