Bug 1700915
| Summary: | inconsistent MAXTIME vs MAX_TIME | ||
|---|---|---|---|
| Product: | [Retired] Restraint | Reporter: | Jeff Bastian <jbastian> |
| Component: | general | Assignee: | Tomas Klohna 🔧 <tklohna> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 0.1.39 | CC: | asavkov, bpeck, breilly, cbeer, mastyk, tklohna |
| Target Milestone: | 0.1.40 | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-05-20 11:47:14 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jeff Bastian
2019-04-17 16:04:28 UTC
Oops, I forgot the link to the source code for the parameter: https://git.beaker-project.org/cgit/restraint/tree/src/task.c#n328 Looking at the flow, it makes sense to me though. 1. You define the max time in the task metadata 2. In case you have RSTRNT_MAX_TIME defined you overwrite that value 3. Value of max time is extracted to RSTRNT_MAXTIME I'm not sure if we are making any changes to max time between the steps 2 and 3 but in case we need to that in the future, we won't cause any breaking. But I understand the point and I would actually be for deprecating RSTRNT_MAX_TIME in favor for KILLTIMEOVERRIDE so there's no confusion. Just to let you know, the RSTRNT_ prefix was used to keep from possibly contaminating the environment variables.. The inconsistency is confusing, though, for writing a task vs running it.
When writing a task, you might check it like so:
if [ $RSTRNT_MAXTIME -lt $THRESHOLD ]; then
...
fi
And then you schedule a Beaker job to run your task and have to set a different name:
<params>
<param name="RSTRNT_MAX_TIME" value="100"/>
</params>
Trying to remember which one takes the underscore and which one does not is a recipe for a headache.
(In reply to Jeff Bastian from comment #4) > The inconsistency is confusing, though, for writing a task vs running it. > > When writing a task, you might check it like so: > > if [ $RSTRNT_MAXTIME -lt $THRESHOLD ]; then > ... > fi > > And then you schedule a Beaker job to run your task and have to set a > different name: > > <params> > <param name="RSTRNT_MAX_TIME" value="100"/> > </params> > > Trying to remember which one takes the underscore and which one does not is > a recipe for a headache. I get that Jeff, I was suggesting we support both and only document one. I believe Tomas suggestions was to document the non name-spaced KILLTIMEOVERRIDE. Restraint 0.1.40 has been released. |