Fixed START_AT jobs disregarded while evaluating, and fixed the update of their score.
ClosedPublic

Authored by TallFurryMan on Jan 7 2019, 2:43 PM.

Details

Summary

In KStars 3.0, Scheduler jobs are checked against each other to produce the final plan and detect scheduling issues (compared to pre 3.0 which schedules jobs independently first).
In KStars prior to 3.0, when a Scheduler job was set to start at a specific date, the implementation considered the evaluation of that job could simply be bypassed.
Unfortunately, the specific bypass of fixed-startup jobs remained in 3.0 and caused those jobs to avoid the verification sequence and disappear from the list of jobs to be processed.
This differential fixes this behavior.

This differential also fixes the update of the score of these jobs in the job table, which was not updated for fixed-startup jobs.

Test Plan

Warning: it now appears that fixed-startup jobs completely slipped through the integration tests of KStars 3.0.

Note that a fixed-startup job is non-movable:

  • a fixed-startup job will fail if overlapping another fixed-startup job that is earlier in the schedule list.
  • a non fixed-startup job will fail if overlapping a fixed-startup job, earlier or later in the schedule list.

Create and test execution of schedules with basic enforcement tests:

  • a single fixed-startup job starting in the past: it must end up invalid.
  • a single fixed-startup job starting in the future during the day, with twilight enforcement: it must end up invalid.
  • a single fixed-startup job starting in the future when the target is lower than 15 degrees, with altitude enforcement: it must end up invalid.
  • a single fixed-startup job starting in the future when the Moon is close, with Moon separation enforcement: it must end up invalid.
  • a single fixed-startup job that is acceptable: it must end up schedule, and be retained for execution when starting the Scheduler.

Then create and test execution of schedules using fixed-startup and non fixed-startup jobs (we consider the lead time is configured so that estimation of the duration of jobs is large enough not to cause issues):

  • a single fixed-startup job, followed by a start-asap job: the second job must start after the first job completes, lead time included.
  • two fixed-startup jobs starting at the same time: the second job must end up invalid.
  • a fixed-startup job followed by a second fixed-startup job starting before the completion of the first: the second job must end up invalid.
  • a start-asap job followed by a fixed-startup job: depending on its completion time vs the fixed-startup job, the start-asap job must end up invalid or scheduled (the fixed-startup job must remain scheduled!)
  • two fixed-startup jobs, plus a start-asap job in-between: depending on its completion time vs the second fixed-startup job, the middle start-asap job must end up invalid or scheduled (the second fixed-startup job must remain scheduled!).

In all situations described, the current score must be adequate and not remain to zero (when applicable).

Observe as invalid jobs are automatically moved to the end of the queue. This is somewhat not very user friendly.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
TallFurryMan created this revision.Jan 7 2019, 2:43 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptJan 7 2019, 2:43 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Jan 7 2019, 2:43 PM
mutlaqja accepted this revision.Jan 7 2019, 3:01 PM
This revision is now accepted and ready to land.Jan 7 2019, 3:01 PM
This revision was automatically updated to reflect the committed changes.

I found some minor things while playing around, but nothing serious:

  • How does priority and fix startup time correlate? Currently, a job with a lower priority needs to have a earlier startup time. Otherwise, the other one will be marked invalid. To be discussed, I would expect that such a schedule is valid.
  • A culmination determined job, that precedes but overlaps a fix startup time job, is set to aborted. I would expect that the fix startup time job is invalid.
  • A job with fix startup time and duration set to a "repeat until" time that is earlier than the startup time leads to status "completed". Hm, formally correct, but I would consider this as an invalid configuration.
TallFurryMan added a comment.EditedJan 7 2019, 8:14 PM

I found some minor things while playing around, but nothing serious:

  • How does priority and fix startup time correlate? Currently, a job with a lower priority needs to have a earlier startup time. Otherwise, the other one will be marked invalid. To be discussed, I would expect that such a schedule is valid.
  • A culmination determined job, that precedes but overlaps a fix startup time job, is set to aborted. I would expect that the fix startup time job is invalid.
  • A job with fix startup time and duration set to a "repeat until" time that is earlier than the startup time leads to status "completed". Hm, formally correct, but I would consider this as an invalid configuration.

Your remarks are indeed valid.
Right now, priority will only affect two jobs being scheduled when the sort option is enabled. In the future, I'd like Scheduler to be able to alternate between multiple looping jobs with dynamic priorities.
About the culmination being set to invalid instead of the fixed-startup job, I had to make a choice and chose the most general implementation, that is, fixed-startup retain priority.
About the inverted startup/completion time, I ended up with this behavior when repeating a job. The only way to complete a fixed-completion job is to exceed the completion time. It happened the case you refer to was handled gracefully by the implementation of this rule, so I left it as is, nearly surprised that additional code would for once not induce a crippling side effect somewhere else :)