Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
libutil: add fsd_parse_duration(), support standard duration string in some utilities #2095
This PR adds a libutil function to parse the proposed RFC 23 Flux Standard Duration, and uses that function to add an
At the same time, all uses of jobspec duration were updated to take duration as a strict float number of seconds as proposed in flux-framework/rfc#177. Unfortunately, this had to go in as one big commit since everything depends on everything else.
In retrospect perhaps the jobspec duration should be a separate PR, but first people could comment on the change. It is best to get this done now, since making the change in the future will likely be more work.
@@ Coverage Diff @@ ## master #2095 +/- ## ========================================== - Coverage 80.28% 80.27% -0.01% ========================================== Files 195 196 +1 Lines 31291 31318 +27 ========================================== + Hits 25121 25140 +19 - Misses 6170 6178 +8
lgtm, just to make sure, you didn't forget these in the broker? Or did you think they shouldn't be adjusted? Obviously not as user facing like the other stuff.
I only quickly searched for users of
Looks like "heartrate" currently takes only an integer with optional
Add a trivial function for converting a string from Flux Standard Duration format to double precision seconds. A function to convert double seconds to human readable FSD is provided for convenience for tools that report these numbers.
Add a function to process and return an option argument in Flux Standard Duration (floating point seconds with optional s,m,h,d suffix).
Standardize some commands that take a duration in floating point seconds to use optparse_get_duration(), allowing a suffix of 's,m,h,d' to be used.
Update job-exec module to use shared fsd_parse_duration() instead of internal function for parsing standard duration strings.
Update the broker's --shutdown-grace option to take a standard duration argument, allowing an optional 's,m,h,d' suffix.
Switch --heartrate option to take a duration string parsed by fs_parse_duration(). Update test for 'ms' suffix to specify in floating point seconds instead.
Use fsd_parse_duration () to process "hello.timeout" broker attribute so that a standard duration string may be used.
Process the init.rc2_timeout broker attribute using fsd_parse_duration, to allow a standard duration string to be used here.
@@ Coverage Diff @@ ## master #2095 +/- ## ========================================== + Coverage 80.29% 80.31% +0.01% ========================================== Files 195 196 +1 Lines 31291 31311 +20 ========================================== + Hits 25125 25147 +22 + Misses 6166 6164 -2