I have an action-chain and the following policy:
---
name: deploy_vm.concurrency
description: Limits the concurrent executions for the deploy_vm workflow
enabled: true
resource_ref: crv_vm.deploy_vm
policy_type: action.concurrency
parameters:
action: delay
threshold: 1
As documented at https://docs.stackstorm.com/reference/policies.html I had to add Redis or ZooKeeper to the Stack. I chose Redis. I configured a coordinator_url and when I execute two deploy_vm workflows at the same time the second one gets the status "delayed" and start running as soon as the first one is finished. So that works perfectly.
However I was trying to validate If I saw some data in Redis and was curious how the key was composed and what the value was. But during the executions I got the following response everytime:
127.0.0.1:6379> keys "*"
(empty list or set)
127.0.0.1:6379> keys "*"
(empty list or set)
127.0.0.1:6379> keys "*"
(empty list or set)
127.0.0.1:6379> keys "*"
(empty list or set)
So is Redis indeed used or is something else going on? How can I validate this?
I powered off the Redis server and I still get the same behaviour, that the second workflow execution gets the status delayed until the first is finished. So is the note from the documentation not correct (anymore)?
"The concurrency policy type is not enabled by default and requires a backend service such as ZooKeeper or Redis to work."
+1 I also have this question, I'm interested how to view the keys, values in redis.
Ok got my answer. To get your keys/values (string types) in redis in a python terminal try this while your st2 executions are running:
>>> import redis
>>> r = redis.Redis("localhost", 6379)
>>> while True:
... keys = r.keys()
... if keys:
... values = r.mget(keys)
... kv = zip(keys, values)
... print 'Dumping keys:'
... print kv
Thanks for the followup @tim-ireland - will be useful for someone else searching for this in future
Most helpful comment
Ok got my answer. To get your keys/values (string types) in redis in a python terminal try this while your st2 executions are running: