Skip to content

1.5.2

Choose a tag to compare

@msx752 msx752 released this 15 Nov 03:47
75233cf

1.5.2 fixes five faults reported against 1.5.1 and earlier: a cron expression that stopped the scheduler loop, numbers of an application's own ticker type that Redis rewrote, chain children whose time was read in the wrong zone or whose interrupted run was skipped, and a stored cron ticker that did not run without a word. No database migration for EF Core, no change of the MongoDB collections, no new Redis key, no change of the public API or of a default.

Fixed

Scheduling

  • A cron whose expression matches no date no longer stops the scheduler loop (#194). An expression such as 0 0 0 30 2 * (the 30th of February) parses, and WithCron in code accepts it. The cron library threw for it, so while such a cron ticker was stored the loop failed on every pass and started no job on time, cron or time; only the fallback started overdue jobs, and the dashboard's list of cron jobs failed. The loop now skips that cron ticker, and adding or updating one is refused. A cron seeded from code with such an expression is still stored; the startup Warning of #79 names it.
  • A stored cron ticker that does not run is named in a Warning at startup (#79). Each enabled cron ticker whose expression has no next occurrence (five fields stored by a version before 1.5.0, a configuration placeholder whose key is missing, an expression that matches no date) is named once with its id, its function and the expression, on each instance. The check does not stop the startup.

Chains

  • The times of delayed children and grandchildren are converted to UTC like the root's (#81). When a chain was added, a child time given as DateTimeKind.Local or Unspecified was stored as given, so on a machine not on UTC the child ran hours off. When a chain is added through the dashboard API, a timeZoneId now applies to every time of the chain.
  • A chain child that starts with its parent and was left waiting runs when its parent started (#158). A child with RunCondition.InProgress and no time of its own that still waited after its parent ended was recorded Skipped, also when its run had been interrupted by a stopped node and released. The fallback now runs it when the parent started (Done, DueDone, Failed, Cancelled) and skips it when the parent was skipped.

Redis as the job store

  • Numbers of an application's own ticker type are kept (#151). Claims, releases and skips were Lua scripts that rewrote a record with the JSON library of Redis, which keeps 14 significant digits: a long of 15 digits or more came back in exponent form, the record could not be read and the job did not run; a long double was rounded. The store now makes these writes with the serializer that wrote the record.

Behaviour changes to check before upgrading

  • Delayed chain children with Local or Unspecified times now run at the time the caller meant. A caller that built an Unspecified value meaning UTC on a machine not on UTC gets it shifted by the scheduler zone's offset, as the root's was. Times already stored are not changed.
  • InProgress chain children left waiting run (DueDone, 30 seconds plus up to one FallbackIntervalChecker after the parent's end) where they were Skipped. A child killed with its node can run twice, as any released job can. With the Redis heartbeat's self-fence, which does not ask such a child to stop, a child still running on a cut-off node can run a second time at the same time once its row is released. A child 1.5.1 already recorded as Skipped stays so.
  • Redis: upgrade all instances together. An instance still on 1.5.1 rewrites a record when it claims it. A record 1.5.1 already wrote back in exponent form is not repaired, because its digits are lost; it is named in a warning with its key: delete or update that job.
  • Redis: a record that cannot be read is no longer taken by the fallback and left InProgress; it stays as it is and is named on each read.
  • Redis: each claim, release and skip is a read and a compare-and-set, two round trips where a script was one.
  • A cron expression that matches no date is refused when a cron ticker is added or updated, with "Cannot parse expression ..., or it matches no date".

Upgrade

From 1.5.1: no schema or data step. With Redis, upgrade all instances together. Correct or remove the cron tickers the startup warning names.

Known limits

Unchanged from 1.5.1; see its notes.