Repository navigation
1.6.1 has two fixes, both for Redis as the job store and chains that Redis stored with a version before 1.3.0, which keep their children inside the parent's record until an instance that takes the parent to run it writes them as records of their own: a parent taken by the fallback or run-now while the scheduling loop of the same instance writes those records runs with the children written by then, and a delete of such a chain while those records are written removes them as well. No change of the public API, no new default, no database migration for EF Core, no change of the MongoDB collections, no new Redis key.
Fixed
Redis, chains stored before 1.3.0
- A parent taken by the fallback or run-now while its children are written as records runs with them (#154). The children of such a chain are written as records in many Redis calls. When the fallback or run-now of an instance read the parent's children while the scheduling loop of the same instance was still writing them, and then took the parent, the parent was run with only the children written before that read; in a test, one of three. A child without a time of its own that was missing was left to the fallback, which takes such a child once its parent ended at least 30 seconds ago. When the record read before the claim held the children inside it, or could not be read, and the claimed record no longer does, the children are now read again after the claim, and the parent runs with the children written by then. If that read fails, a warning is logged, the claim is put back and the parent is not run; the next pass tries again. As in 1.6.0, the scheduling loop does not start the parent a second time: its start is refused once the fallback or run-now holds the record.
- A delete of such a chain while its children are written as records removes those records (#153). A delete read the chain's children once, so children that the instance writing them linked after that read stayed as
Idlerecords without a parent, which do not run. The delete still removes the children's records first, but keeps their children sets; it then removes the parent's record, reads the chain's children again and removes what it finds, and removes the parent's index entries last. When the last write of the instance that writes the children does not land, or one of its writes fails, that instance checks for the parent's record: when the record is gone, it removes the records it wrote and does not run the parent. If the check or the removal fails, a warning is logged; then, or when that instance stops before it, the records that were not removed stay asIdlerecords without a parent that do not run.
Behaviour changes to check before upgrading
- Redis: a delete makes more calls (#153). A delete of a time ticker walks its children a second time, after it removed the ticker's record, and removes the ticker's index entries last; for a chain the number of Redis calls is about twice what it was, for a ticker without children one more. The other stores are not changed.
- Redis: one more read for a split chain (#154). The fallback and run-now read the children of a chain stored before 1.3.0 again after they took it, when its record no longer holds them. Other jobs are not affected, except one whose record could not be read before the claim.
- Redis: a delete that stops on a store failure (#153). One that stops before the parent's record is removed leaves the parent listed, and deleting it again removes the rest, as before. One that stops after it leaves no record, only index entries and children sets of records that are gone; reads skip those. Up to 1.6.0 a delete that stopped between its index entries and the parent's record left that record unlisted.
Upgrade
From 1.6.0: no step. Upgrade all instances together, as before.
Known limits
- Chains stored before 1.3.0 on Redis. When the instance that writes the children of a deleted chain cannot check for the parent's record or remove them, or stops before it, the records it wrote after the delete's last read of the chain's children stay as
Idlechildren without a parent that do not run. A chain whose parent had already ended still keeps its children inside its record, and they are not run; delete it and add it again. - Rolling upgrade. The fix of #153 needs both the instance that deletes the chain and the instance that writes its children on 1.6.1; while an instance is still on 1.6.0, records written after the delete read the chain's children can stay as in 1.6.0.
- Otherwise unchanged from 1.6.0; see its notes.