Retry delay is set to a maximum of 5 seconds
Open
@Kami is already working on this.
Since Aug 1, 2017.
complexity:medium
enhancement
policies
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
If you try to make a retry policy with a delay of longer than 5 seconds, it will not register. With this policy:
---
name: test-retry
description: Retry test if it fails
enabled: true
resource_ref: examples.test
policy_type: action.retry
parameters:
retry_on: failure
delay: 30
When you try to register it, it complains:
2017-07-28 22:30:59,712 INFO [-] =========================================================
2017-07-28 22:30:59,712 INFO [-] ############## Registering policies #####################
2017-07-28 22:30:59,712 INFO [-] =========================================================
2017-07-28 22:30:59,720 WARNING [-] Failed to register policies: Failed to register policy "/opt/stackstorm/packs.dev/examples/policies/test-retry-policy.yaml" from pack "examples": 30 is greater than the maximum of 5
Failed validating u'maximum' in schema['properties'][u'delay']:
{u'description': u'Number of seconds to wait before retrying the execution.',
u'maximum': 5,
u'minimum': 0,
u'required': False,
u'type': [u'number', 'null']}
On instance[u'delay']:
30
Traceback (most recent call last):
File "/usr/bin/st2-register-content", line 22, in <module>
sys.exit(content_loader.main(sys.argv[1:]))
File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2common/content/bootstrap.py", line 387, in main
register_content()
File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2common/content/bootstrap.py", line 341, in register_content
register_policies()
File "/opt/stackstorm/st2/local/lib/python2.7/site-packages/st2common/content/bootstrap.py", line 303, in register_policies
raise e
ValueError: Failed to register policy "/opt/stackstorm/packs.dev/examples/policies/test-retry-policy.yaml" from pack "examples": 30 is greater than the maximum of 5
Failed validating u'maximum' in schema['properties'][u'delay']:
{u'description': u'Number of seconds to wait before retrying the execution.',
u'maximum': 5,
u'minimum': 0,
u'required': False,
u'type': [u'number', 'null']}
On instance[u'delay']:
30
5 seconds is incredibly and arbitrarily short. Honestly, I don't think there should be a maximum at all. If I want to delay my action's retries for 4 hours, or 4 days, or 4 weeks, I should be able to.
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.
Assessment
This issue has not been assessed yet.