Commit Graph

36 Commits

Author SHA1 Message Date
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
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
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
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
Tom Morelly cc66c780d8
feat(eventListener): add BeforeJobRunsSkipIfBeforeFuncErrors() (#813) 2025-01-08 19:21:13 -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 dec269f8a7
fix overly greedy panic handler (#800) 2024-11-20 12:17:01 -06: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
Higan 970c5399bc
wrap ErrPanicRecovered with recoverData (#749) 2024-07-03 10:23:45 -05:00
John Roesler baf731c6f9
fix jobs not starting on scheduler restart when using WithLimitConcurrentJobs (#745) 2024-06-27 14:53:35 -05:00
Trung Duong 399ac2807b
Add `AfterJobRunsWithPanic` (#733) 2024-06-20 07:01:36 -05:00
Manuel Doncel Martos 894970124c
after lock error listener (#734)
* after job listener

* fixing lint issues

---------

Co-authored-by: lv90no <manuel.doncel.martos@ing.com>
2024-06-19 06:33:50 -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 cde2513062
Monitor: IncrementJob in case of skipped job run (#715)
Co-authored-by: John Roesler <johnrroesler@gmail.com>
2024-04-29 13:29:11 -05:00
Giridharan Ramasamy 3faf525f98
Added Distributed Locker to JobOptions (#711) 2024-04-22 13:52:27 -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 ebec5e9f91
elector & locker were failing to send out when not leader (#688)
* elector & locker were failing to send out when not leader

* update test to confirm non-active elector/locker are checked

* clean up data race

* try to make test more reliable
2024-03-12 08:37:11 -05:00
John Roesler 27f2cbaa41
fix cases where default on send out is resulting in job not going out (#686) 2024-03-05 10:55:42 -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 6e15f16d77
add new features, OneTimeJob and Job.RunNow() (#646) 2023-12-18 21:13:37 -06:00
John Roesler aa4400d224
Update docs, tests, and release prep (#629) 2023-12-11 10:39:59 -06:00
John Roesler 5814fbcb6f
allow max concurrent runs and singleton mode together (#625) 2023-11-28 06:48:22 -06:00
John Roesler 63225ac1a9
export function comments 2023-11-22 06:43:50 -06:00
John Roesler 77dba0ad18
correct lock to use job.name instead of id (#623)
Co-authored-by: Le Ha Khiem <hakhiem.va@gmail.com>
2023-11-16 07:49:43 -06:00
John Roesler 10ea8986c7
move singleton runner map to be fresh on executor start 2023-11-14 13:52:19 -06:00
John Roesler 8c628fae2d
add job name to event listners (#621)
* add job name to event listners

* missed the examples

* missed executor
2023-11-14 11:39:27 -06:00
John Roesler da0b804d18
remove extra logging in executor 2023-11-14 09:59:48 -06:00
John Roesler 7fea987137
add distributed locker for v2 (#614)
* add distributed locker for v2

* fix logger test

* enhance logger test
2023-11-14 09:56:05 -06:00
Nguyen Thanh Quang 3e2df30371
force `executor` to use attached logger instead of "log" package (#613) 2023-11-12 21:38:11 -06:00
John Roesler 4a57125579
test all remaining With*, and test logger (#609) 2023-11-09 15:04:18 -06:00
John Roesler ad26a71e0e
initial clean v2 commit history 2023-11-08 11:11:42 -06:00