[openstack-dev] [trove] scheduled tasks redux
greg.hill at RACKSPACE.COM
Thu Jan 23 20:20:29 UTC 2014
The blueprint is here:
I've been working on the REST API portion of this project, and as I was working on the client, a part of it didn't sit quite right. As it is specified, it calls for two fields to define when and how often to run the task:
"frequency" : "hourly|daily|weekly|monthly",
The concept of combining two datetimes into a single field feels awkward when using the API from a client perspective. I originally thought I'd just split it into two date times, but that still felt wrong. We did some internal discussion here at Rackspace, and it was brought up that the date doesn't actually matter in this scenario. All we care about is what time to run the task and how frequently to repeat it. Apparently some of the original discussion was more around a crontab style entry, but with a time window rather than a fixed time, but that didn't get put into the spec. For those who might be wondering, the purpose of the window rather than a fixed time is to give some leeway to the system to not overload things when everyone wants to fire off a backup at midnight. There could be a configurable minimum window size that defaulted to 2 hours, so by default we'd only guarantee a task was run within a two hour window, which could be adjusted up or down by operators.
So I have basically two questions:
1. Does anyone see a problem with defining the repeating options as a single field rather than multiple fields?
2. Should we use the crontab format for this or is that too terse? We could go with a more fluid style like "Every Wednesday/Friday/Sunday at 12:00PM" but that's English-centric and much more difficult to parse programmatically. I'd welcome alternate suggestions.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev