Commit e6a4a35
Scheduler Bugfix: getFutureActionTimes should ignore actions prior to update time, respect RemainingActions counter (#6122)
## What changed/why?
In #6028/#5381, our scheduler's run loop accounted for update requests
that occur between nominal and actual/jittered times. The run loop will
correctly skip over action times who are scheduled prior to the
schedule's update time (such as when a schedule is recalculated to a new
spec). This PR updates `getFutureActionTimes` (used as part of the
scheduler's describe and list operations) to account for action times
preceding the update time, as well as to properly reflect the number of
remaining actions in a schedule.
## How did you test it?
- Updated unit tests for both limited actions (`TestLimitedActions`) as
well as filtered update times (`TestUpdateNotRetroactive`).
`TestUpdateNotRetroactive` is the test that goes red when the [parallel
condition in the
scheduler](https://github.com/temporalio/temporal/blob/44a6fe777e1dc950dd278cb1b7f6ffc8b3ba4328/service/worker/scheduler/workflow.go#L655-L660)
is commented out, so it seemed the appropriate place to also test
`getFutureActionTimes` lines up with the fix in the run loop.
- Verified both updated tests only pass when new version
(`AccurateFutureActionTimes`) is set; verified no other tests break
(`make test-unit`)
## Potential risks
- We break a use case that relied on speculative future action times/a
constant number of action times returned
## Documentation
N/A
## Is hotfix candidate?
No1 parent 1006877 commit e6a4a35
2 files changed
+46
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
931 | 933 | | |
932 | 934 | | |
933 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
934 | 941 | | |
935 | 942 | | |
936 | 943 | | |
| |||
950 | 957 | | |
951 | 958 | | |
952 | 959 | | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
953 | 964 | | |
954 | 965 | | |
955 | 966 | | |
| |||
960 | 971 | | |
961 | 972 | | |
962 | 973 | | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
963 | 980 | | |
964 | 981 | | |
965 | 982 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1622 | 1627 | | |
1623 | 1628 | | |
1624 | 1629 | | |
| |||
1656 | 1661 | | |
1657 | 1662 | | |
1658 | 1663 | | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
1659 | 1674 | | |
1660 | 1675 | | |
1661 | 1676 | | |
| |||
1844 | 1859 | | |
1845 | 1860 | | |
1846 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
1847 | 1867 | | |
1848 | 1868 | | |
1849 | 1869 | | |
| |||
1870 | 1890 | | |
1871 | 1891 | | |
1872 | 1892 | | |
1873 | | - | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
1874 | 1896 | | |
1875 | 1897 | | |
1876 | | - | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
1877 | 1901 | | |
1878 | 1902 | | |
1879 | | - | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
1880 | 1906 | | |
1881 | 1907 | | |
1882 | 1908 | | |
| |||
0 commit comments