Barkhayot Juraev
93ffeadbf6
[fix] race condition in `NextRun()` when multiple jobs complete simultaneously ( #907 )
...
* fix: select execute job on complete
* fix: update next job scheduling
* fix: handle test case
* feat: test next run with multiple jobs
* feat: test next run with concurrent completions
* fix: remove iteration param based on feedbacks
---------
Co-authored-by: Barkhayot Juraev <barkhayotjuraev@Barkhayots-MacBook-Pro.local>
2026-01-28 09:43:58 -06:00
Yash Chauhan
f4c6d141a9
feat: add scheduler lifecycle monitoring <> #785 ( #889 )
...
* git commit -m "feat: add SchedulerStarted and SchedulerStopped monitoring"
* fix lint issue
* Update errors.go
Co-authored-by: John Roesler <johnrroesler@gmail.com>
* feat() updated with remaning metrics & events (JobRegistered/JobUnregistered, JobStarted/JobRunning/JobFailed/JobCompleted)
* feat: enhance scheduler and job observability by adding new monitor events for lifecycle, performance, and concurrency limits.
* docs: expand metrics section to include scheduler lifecycle events and `SchedulerMonitor` details with Prometheus example
* refactor: conditionally send scheduler notifications only when a scheduler monitor is configured.
---------
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2025-12-02 10:25:51 -06:00
John Roesler
9cc3be7cff
fix: calling start multiple times should no-op ( #901 )
...
* fix: calling start multiple times should no-op
* give test more time after start
* add a mutex
2025-11-26 13:38:55 -06:00
John Roesler
5b2fe32639
fix: WithStartDateTimePast now correctly calculates from past time ( #897 )
2025-11-24 10:08:17 -06:00
Yash Chauhan
3ee53e03d9
feat: Add option to calculate intervals from job completion time for interval-based scheduling ( fixes #565 ) ( #884 )
2025-10-21 22:09:46 -05:00
John Roesler
536410f98a
fix: multiple calls to shutdown should be no-op ( #880 )
...
* fix: multiple calls to shutdown should be no-op
* timing was off - need to cancel context before returning early
2025-10-09 11:19:35 -05:00
apocelipes
028b401157
Reusing the results of reflections to improve performance ( #873 )
2025-09-28 22:35:39 -05:00
sarff
d56a063ca0
Added a return to the selectRunJobRequest function ( #872 )
2025-09-17 10:06:55 -05:00
Copilot
9e8c79dc9b
Fix memory consumption issue by changing jobOutRequest channels to use pointers and reducing buffer size ( #864 )
...
* Initial plan
* Fix memory consumption issue by changing jobOutRequest channels to use pointers
Co-authored-by: JohnRoesler <19351306+JohnRoesler@users.noreply.github.com>
* Change jobOutRequest channel buffer size from 1000 to 100
Co-authored-by: JohnRoesler <19351306+JohnRoesler@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JohnRoesler <19351306+JohnRoesler@users.noreply.github.com>
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2025-08-27 11:03:34 -05:00
John Roesler
fcfcb87056
fix: cancel job contexts in create/update errors ( #858 )
2025-07-21 12:28:36 -05:00
apocelipes
63f3701d57
Fix #835 and #837 ( #836 )
2025-02-26 09:28:43 -06:00
Manuel Doncel Martos
2769f0940f
removes nextRuns in the past when job skipped by locker ( #829 )
...
Co-authored-by: manuelarte <manuel.doncel.martos@gmail.com>
2025-02-17 15:43:46 -06:00
Guang Jiong Lou
a757eff276
fix scheduler restart ( #825 )
2025-02-07 10:28:32 -06:00
apocelipes
0c4a1a3292
replace "golang.org/x/exp" with standard libraries ( #823 )
2025-01-31 09:17:45 -06:00
John Roesler
5b49603168
working to handle edge cases where a job can be run twice, unexpectedly ( #810 )
2025-01-28 21:22:56 -06:00
John Roesler
96fe017828
clarify context docs
2025-01-23 14:09:03 -06:00
John Roesler
8df2bbf7cd
clarify context docs
2025-01-23 14:07:29 -06:00
John Roesler
ce204f9d74
check context not nil, and update test and docs ( #820 )
2025-01-23 13:30:12 -06:00
Guang Jiong Lou
50966c7365
cancel running jobs if possible when run Scheduler.StopJobs() ( #819 )
...
* cancel running job when run Scheduler.StopJobs()
Signed-off-by: lou <alex1988@outlook.com>
* trivial
Signed-off-by: lou <alex1988@outlook.com>
* Update scheduler_test.go
---------
Signed-off-by: lou <alex1988@outlook.com>
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2025-01-23 12:27:28 -06:00
Hossein Shahsahebi
f5a5a2d0bc
feat: allow disabling global distributed locker per job ( #811 )
...
* chore: fix distributed locker tests
* feat: allow disabling global dist locker per job
2025-01-03 15:12:34 -06:00
Tom Morelly
edb147514f
feat(monitor): introduce MonitorWithStatus ( #780 )
...
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2024-12-11 22:23:57 -06:00
John Roesler
560a9dc9e4
stop timeout timers when no longer needed ( #803 )
2024-12-11 10:43:27 -06:00
Barkhayot
40b8570e23
fix: cleanup timers ( #776 )
...
* fix: cleanup timers
* chore: bring comments back
2024-09-16 09:57:39 -05:00
Higan
68dba115b2
add Singleton job rescheduled metric ( #763 )
2024-07-24 10:24:54 -05:00
Higan
3b2dcd869b
issue-654: allow setting a stopTime for job. ( #760 )
2024-07-19 13:10:28 -05:00
John Roesler
256265f9a2
internal refactoring of JobOption constructor, clock moved to exec ( #761 )
2024-07-18 11:32:56 -05:00
apocelipes
f37e274abb
issue-756: fix interface variadic parameters verifying ( #757 )
2024-07-17 06:56:17 -05:00
Higan
2c08083603
issue-677: support task creation with variadic args ( #755 )
2024-07-11 21:24:08 -05:00
Samuel Attwood
9747c90947
issue-751: fix bug in selectExecJobsOutForRescheduling ( #752 )
2024-07-09 09:39:51 -05:00
John Roesler
9d27ea8673
minor refactor
2024-07-01 09:28:04 -05:00
Rodrigo Broggi
212db8e476
issue-740: ascending time function ( #744 )
...
* issue-740: ascending time function
* issue-740: update documentation
* issue-740: un-export ascending function
* issue-740: sentence correction
2024-06-23 13:14:35 -05:00
Rodrigo Broggi
7c391d4326
issue-742: bug in `NextRun` ( #743 )
...
* issue-742: bug in `NextRun`
* issue-742: bug in `NextRun` correction
2024-06-21 09:17:34 -05:00
Rodrigo Broggi
fd18ca7b52
issue-736: moving validation of one-time to ( #737 )
...
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2024-06-20 14:21:05 -05:00
John Roesler
d808cd93a2
add note about limit mode precedence sched vs. job
2024-05-06 10:26:56 -05:00
John Roesler
e46cdc9d11
fix memory leak with singleton mode where job is sending duplicate reschedule requests ( #723 )
...
* fix memory leak with singleton mode where job is sending duplicate reschedule requests
* add a comment
* fix memory leak for limitmode as well
* tests are happy locally - some timing issues in actions
2024-05-02 11:35:57 -05:00
Giridharan Ramasamy
5f14dac979
Added JobsWaitingInQueue in Scheduler ( #721 )
...
* Added JobsWaitingInQueue in Scheduler
* Fixed tests
2024-04-30 14:32:20 -05:00
John Roesler
3b653b99e4
fix nextRun with singleton mode reporting incorrect time ( #705 )
...
* fix nextRun with singleton mode reporting incorrect time
* only remove past if >1, sort next scheduled
* update test, remove no longer needed lastScheduledRun
2024-04-05 20:56:22 -05:00
John Roesler
dcd4edae17
fix case where OneTimeJob with concurrent limit and limited runs fails to run ( #703 )
2024-03-26 16:29:25 -05:00
John Roesler
9ae7545c27
add another out channel so we can properly report lastRun ( #700 )
...
* add another out channel so we can properly report lastRun
* don't block on channel send
* add tests
2024-03-26 09:55:21 -05:00
John Roesler
41dd412a49
fix case where job removed causes panic when rescheduling ( #698 )
2024-03-23 13:57:09 -05:00
John Roesler
b1ffc665fb
fix RunNow() when calling from a job returned by Jobs() ( #668 )
2024-02-02 09:46:08 -06:00
John Roesler
567cb9695c
fix unsafe map usage in singletonMode ( #665 )
...
* fix singletonMode unsafe map
* update lint issues
---------
Co-authored-by: a3sroot <a3sroot@gmail.com>
2024-01-30 15:50:10 -06:00
John Roesler
5c69001e27
Add job monitor interface to allow for collecting job metrics ( #659 )
...
* Add metrics each run of job
* Fix lint
* Fix test lint
* Fix backwards job status
* Add tags
* Comment example
* Rename it
* Fix some names
* Fix readme
* update readme, examples, naming
* fix unrelated test that was leaking scheduler
* remove overzealous leak detection
* rename interface methods
---------
Co-authored-by: gorodet-sky <gorodetsky.dev@gmail.com>
2024-01-17 15:39:11 -06:00
John Roesler
800821c923
wait for new job to be fully created before returning ( #658 )
2024-01-17 11:48:25 -06:00
John Roesler
ae366d91ea
make the order of the returned jobs slice deterministic ( #652 )
2024-01-02 10:47:01 -06:00
John Roesler
29a2f29e3c
fix to handle when next ends up in the past ( #650 )
...
* fix to handle when next ends up in the past
* add code comments
2024-01-02 10:32:14 -06:00
John Roesler
a51820e30f
fixup Job and Scheduler interface docs
2023-12-20 15:16:16 -06:00
John Roesler
93fecb6152
move scheduler docs to interface
2023-12-20 07:13:58 -06:00
John Roesler
6e15f16d77
add new features, OneTimeJob and Job.RunNow() ( #646 )
2023-12-18 21:13:37 -06:00
John Roesler
80a4f43686
check function param length and type ( #638 )
2023-12-14 13:52:32 -06:00