Commit Graph

52 Commits

Author SHA1 Message Date
Sam 2b8d4508e5 PERF: stop running background work between requests
Use a dedicated thread to run Scheduler::Defer

This avoids blocking of a worker during operations that require waiting.

In particular uploads risked blocking a unicorn.

This also add a queue "length" that discourse prometheus consumes.
2017-11-23 15:48:47 +11:00
Sam 7ca08216bd FIX: ensure we have no dangling db connections on threads
This correct 10 second timeouts in dev mode, when reloader kicks in
2017-10-30 14:24:15 +11:00
Sam 55d096ee8b FEATURE: add event for scheduled_job_ran 2017-10-23 17:22:17 +11:00
Guo Xiang Tan 9dcb11f553 Fix the build. 2017-10-11 17:45:19 +08:00
Guo Xiang Tan 36f8697a59 FIX: Exception has to be wrapped in the connection as well. 2017-10-11 17:19:26 +08:00
Guo Xiang Tan 09721090a3 FIX: Ensure that we revert back to default connection after running jobs. 2017-10-11 17:17:03 +08:00
Sam 9b4fd0b26b correct multisite issues with scheduler 2017-10-11 18:46:53 +11:00
Sam 6b4a1af160 FIX: don't attempt to schedule if there is no next run 2017-10-11 14:27:16 +11:00
Sam 233299982f keep time consistent, we always use to_i 2017-10-11 14:26:50 +11:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Sam 04eac9f14a lets attempt to get these specs working! 2017-07-24 18:35:20 -04:00
Sam f67e715ef1 comment out specs that break others
will check in a fixed spec tomorrow
2017-07-24 17:28:24 -04:00
Sam f97fb7b70c tighten time to stop schedueler 2017-07-24 15:19:54 -04:00
Sam 0c47153808 clean up stop semantics 2017-07-24 15:17:48 -04:00
Sam c08a7aee8f clean up skipped tests
tighter connection handling in scheduler
2017-07-24 15:06:24 -04:00
Sam 66ef7976ea FIX: don't re-scheduler correctly scheduled daily tasks 2017-07-24 14:30:43 -04:00
Guo Xiang Tan d940166a89 Re-enable skipped `Scheduler::ScheduleInfo` test. 2017-07-25 00:03:03 +09:00
Guo Xiang Tan c3b5bca0e8 Log error for all exceptions in scheduler stats. 2017-04-26 09:33:05 +08:00
Guo Xiang Tan 1f6418f907 Track error message in `SchedulerStats`. 2017-04-26 01:34:25 +08:00
Sam e9ba6e4e99 clean up formatting reports 2016-05-31 07:57:28 +10:00
Sam 3eec0a83b0 clean up stop semantics and bypass test 2016-05-30 13:59:58 +10:00
Sam cc088956bc correct some test concurrency bugs 2016-05-30 12:28:05 +10:00
Sam c9dcffe434 FEATURE: store history for scheduled job execution 2016-05-30 11:38:08 +10:00
Régis Hanol fbacaab2fc FIX: disable scheduled jobs when in readonly mode 2016-01-11 18:31:28 +01:00
Sam f85b59b6d4 FIX: you could not manually trigger jobs via sidekiq ui 2015-08-24 16:44:41 +10:00
Sam 5373413102 skip runner params changed 2015-06-26 14:02:17 +10:00
Sam d6d9a7fa09 FEATURE: per host regular jobs
These are jobs that will run on every host that is running discourse.

If you have multiple hosts running the same site you get independent
schedules
2015-06-26 13:37:05 +10:00
Sam 6960639c58 Merge pull request #3190 from riking/thrown_logging
Delete old ErrorLog, use Logster for 500 errors
2015-02-23 14:19:16 +11:00
Sam cdef67667a PERF: allow background jobs to flush between requests in same thread 2015-02-17 09:58:43 +11:00
riking 5657006aca Rename handle_exception to handle_job_exception 2015-02-09 12:47:46 -08:00
Sam 08b790b3c2 improve metrics gathered using in our traffic section
this also pulls out the middleware into its own home and inserts in front
2015-02-05 16:08:52 +11:00
Régis Hanol de76b512c1 fix most deprecations in the specs (still some left) 2014-09-25 17:44:48 +02:00
Régis Hanol 3fe6fc54d9 FEATURE: add an alert in sidekiq's scheduler tab when sidekiq is paused 2014-08-20 20:01:57 +02:00
Sam b160882ef2 Improve identity for scheduler 2014-08-19 20:56:46 +10:00
Akshay b4e38e5646 updated checks of environment with Rails.env by Rails.env methods 2014-08-18 15:36:47 +05:30
riking d90404e830 Change 'code' to 'message' 2014-07-17 15:19:58 -07:00
riking 12cb682548 Start passing more context to Discourse.handle_exception 2014-07-17 14:11:56 -07:00
Sam ead7c52a06 Refactor demonizer in prep for unicorn forking
Upgrade sidekiq
2014-04-17 15:58:00 +10:00
Vikhyat Korrapati 56ee1ac569 Extract scheduler cross-process locking into DistributedMutex. 2014-04-13 00:05:46 +05:30
Sam 798b8444cf BUGFIX: work correctly if process forks 2014-03-17 15:22:11 +11:00
Sam 2c8ae22b87 FEATURE: add a simple queue Scheduler::Defer.later {}
For quick jobs that do not need to be sent to sidekiq,
runs inline in a single thread but does not block
2014-03-17 12:16:19 +11:00
Robin Ward e22f1ae186 Support for a daily job at a certain hour. Convert backup job to run at
3am instead of randomly during the day.
2014-03-14 13:02:45 -04:00
Sam 5c3f2feed4 BUGFIX: recovery code in case an unknown job is scheduled 2014-03-04 07:37:12 +11:00
Sam Saffron 2ab76f60d1 FEATURE: Discoruse.handle_exception
to report exception via sidekiq helper, adds extra context
2014-02-21 14:30:25 +11:00
Sam 71a38542a4 FEATURE: automatic orphan recovery
BUGFIX: improve scheduler robustness, in case redis is disconnected during operation

If sidekiq is terminated while task is running, it will be picked up and ran again
New owner on tasks to help debugging
better #stop semantics for tests
2014-02-12 13:33:24 +11:00
Sam de9e1a5049 BUGFIX: allow sorting prior to sidekiq starting 2014-02-10 09:21:46 +11:00
Sam 12cea8cb92 BUGFIX: scheduler crash in blocking_tick 2014-02-07 11:21:28 +11:00
Sam 0efcb9cee9 BUGFIX: race condition in blocking_tick
causes erratic spec failure
2014-02-07 08:40:43 +11:00
Sam f27ffe3223 BUGFIX: scheduler was showing up empty in multisite 2014-02-07 08:37:02 +11:00
Sam fad80bbee3 Sort schedules by "next run due" time 2014-02-06 10:59:42 +11:00