1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00
Commit graph

660 commits

Author SHA1 Message Date
Mike Perham
c3ea67a79b fix test 2019-09-04 06:30:22 -07:00
Mike Perham
b4d66e5830 fix deprecation 2019-09-03 11:13:13 -07:00
Mike Perham
2f5c482ae0 Inject Sidekiq::LogContext module if user-supplied logger does not already include it, fixes 2019-09-03 11:13:04 -07:00
Mike Perham
62c2f04c93 fix test 2019-08-02 11:07:16 -07:00
Mike Perham
890dce58ec Remove sidekiqctl, add sidekiqmon 2019-08-02 11:07:06 -07:00
Mike Perham
b7996f4564 Better ActiveJob integration with Sidekiq options
This change allows ActiveJobs to directly use sidekiq_options to configure various Sidekiq internals/features, 
2019-07-24 10:52:54 -07:00
Phil Pirozhkov
fc575fbb7e Allow Sidekiq retry options in ActiveJob
c685d6928c
has introduced an exception that is raised on an attempt to include
Sidekiq::Worker to an ActiveJob::Base descendant.

That was done in order to prevent options not supported by ActiveJob,
specifically `queue`. See https://github.com/mperham/sidekiq/issues/2424

Support for `set` was added later on, including the setting of `retry`
from ActiveJob.
d6538b0b4f

This change bridges the gap by allowing ActiveJob::Base descendants to
include `Sidekiq::Options` and use `retry` option of
`sidekiq_options`, and also `sidekiq_retry_in`, and
`sidekiq_retries_exhausted`.
2019-07-24 09:39:12 -07:00
Mike Perham
ffa30bd4a4 merge master 2019-04-16 10:12:04 -07:00
Mike Perham
0089c7162b re-establish Web UI test by stubbing time.now, 2019-04-16 08:59:01 -07:00
Mike Perham
da05cc832e Update tests for 2019-04-16 08:45:18 -07:00
Mike Perham
0a2559b193 Revert "Allow tests to override enqueued_at", fixes
This reverts commit cfe53e5fad.
2019-04-16 08:42:29 -07:00
Mike Perham
ea30e975ba Fix broken build due to 2019-03-27 10:30:52 -07:00
Mike Perham
cd693fa201 Fix broken build due to 2019-03-27 10:30:10 -07:00
Mike Perham
a21e020669 Merge branch 'master' into 6-0 2019-03-06 09:16:49 -08:00
Mike Perham
33aedf62de Allow Sidekiq::Worker#set to be chained 2019-03-04 11:16:58 -08:00
Mike Perham
60bb816235 merge master 2019-03-01 13:37:04 -08:00
Mike Perham
edbefc4ec1 flush redis so status is predictable 2019-03-01 13:27:28 -08:00
Mike Perham
653c58f646 merge master 2019-03-01 13:26:21 -08:00
Mike Perham
4d88319435 Refactor sidekiqctl so it can be tested easily 2019-02-28 14:36:40 -08:00
Mike Perham
20f4cdb4ff Fix various flaky tests due to process-wide data changes 2019-02-28 14:12:08 -08:00
Mike Perham
cfe53e5fad Allow tests to override enqueued_at 2019-02-28 14:05:45 -08:00
Mike Perham
4f057c947d oops 2019-02-28 12:57:29 -08:00
Mike Perham
85a1be3684 Switch all tests to use Minitest::Spec for consistency 2019-02-28 12:43:50 -08:00
Andrew Babichev
db64467fc1 Pluggable Log Formatter ()
* Rename log_format to log_formatter

Rails provides configuration options with this name.

* Pluggable log formatter instance
2019-02-11 13:59:52 -08:00
Mike Perham
731b5d69e4 cleanup 2019-02-08 08:53:50 -08:00
Mike Perham
d911036768 Better handling of malformed job arguments in payload, fixes 2019-02-08 08:53:23 -08:00
Mike Perham
19c44dd5b1 merge master 2019-02-07 11:42:35 -08:00
Mike Perham
d67e82473e remove things which complicate the test suite 2019-02-05 11:10:56 -08:00
Brian Sewell
23e6a5f756 Rescue StandardErrors raised from exception's message ()
* Rescue standard errors raised from exception's message

* Set a default message value if it raises an error

* Update default message value

* Add comments for exception_message
2019-01-31 11:25:00 -08:00
Andrew Babichev
a281aa44a6 Consider Default Required Path on Config File Search ()
* Consider default required path on config file search

* Fix bundler at ci
2019-01-08 09:20:59 -08:00
Mike Perham
d3fc2958d3 modern terminology 2019-01-07 16:30:27 -08:00
Andrew Babichev
6ac6ed5060 Move proctitle from cli to launcher () 2018-12-30 12:15:21 -08:00
Mike Perham
022c63d86f Rework logger changes a bit
* logger_formatter -> log_format
* avoid touching global Sidekiq.logger in JobLogger
* rewrite tests for compactness and coverage
* hide banner in JSON
2018-12-29 07:54:05 -08:00
Andrew Babichev
3845832c20 JSON Logger Formatter ()
* Check Config File Existence ()

* Check config file existence

* Eager config file check

* Parse expanded path to default sidekiq.yml config file in Rails app

* Cleanup

* Add minitest-around

* Extract context from formatter

* Add JSON logger formatter

* Adjust job logger to handle elapsed time within context

* Add tid test

* Rename processor logger

* Enforce global state reset in logging tests

* Add warning about upcoming refactoring to Sidekiq::Logging

* Replace around hook with explicit stub inside test

It's implemented with fibers, which means Thread.current returns different values in JRuby.

* Fix typo

* Concise JSON formatter keys

* Add logger_formatter option

* Shift context from array of strings to hash

Allows more flexibly format context in the different formatters.

* Adjust warning message regarding context type change

* Add "Formatter" suffix to classes

* Fix CLI specs

* Replace Sidekiq::Logging with Sidekiq::Logger

* Namespace logger formatters

* Remove rails 4 appraisal
2018-12-28 15:05:51 -08:00
Mike Perham
84d364ccd2 fix test 2018-12-28 10:08:24 -08:00
Mike Perham
b294ca3c57 merge master 2018-12-28 10:07:03 -08:00
Andrew Babichev
1d835551f0 Check Config File Existence ()
* Check config file existence

* Eager config file check

* Parse expanded path to default sidekiq.yml config file in Rails app

* Cleanup
2018-12-13 08:30:29 -08:00
Mike Perham
5987a8c352 Remove daemonization, pidfile and logfile options, 2018-12-07 13:41:26 -08:00
Mike Perham
586ff812c9 whoops! 2018-12-07 12:42:01 -08:00
Mike Perham
0429ce9d02 Validate REDIS_PROVIDER, fixes 2018-12-07 12:42:01 -08:00
Andrew Babichev
ea9b34a953 Add CLI Run Test - Write Pid, System Boot, Print Banner ()
* Add appraisal

* Test CLI run (write pid, system boot, print banner)

* Cleanup test helper

* Set REDIS_URL to use non-default host in test env

* Move mintiest-focus to test bundle group
2018-12-07 08:59:42 -08:00
Mike Perham
30bbd13a5e Update tests so they all run standalone successfully, like so:
for i in test/test_* ; do ruby $i; done
2018-12-03 14:09:26 -08:00
Andrew Babichev
ddb0c8b3a8 Cleanup CLI ()
* Refactor CLI test

Extracted 3 main parts:
- parse
- run
- signal handling

* Move demonization and pid write from parse to run phase

* Move queues default from validate to setup options phase

* Add pry-byebug gem

* Drop Sidekiq::Test

* Require launcher in CLI

* Remove TODOs
2018-12-03 13:24:37 -08:00
Matt Duszynski
1c44ab6985 sidekiqctl status ()
* Add status output for sidekiqctl

* A little cleanup

* Refactor to Sidekiqctl::Status

* Error handling for section argument

* Rename workers to processes

* Clean up how the queue table is printed

* Refactoring, added tests

* Improve error handling

* Comma-separate values in overview

* Add changelog entry
2018-10-29 12:04:19 -07:00
Mike Perham
003e58161e Fix test suite 2018-10-18 14:35:10 -07:00
Matt Books
64dfc280de Synchronize code that reads/undefines methods in class attrs ()
Fixes  and 

The problem is that when two classes are accessed from separate threads they can
race to undef/read these methods.
2018-10-18 08:27:45 -07:00
Matt Books
927680cae7 Use a mutex to synchronize access to shared WORKER_STATE hash ()
On jruby, the Hash implementation is not threadsafe, and leads to jobs not being
deleted from the busy list.

See 
2018-09-11 09:53:52 -07:00
Tobias Bühlmann
da3fbed14b Use redis' default driver ()
Redis stores its loaded drivers in `Redis::Connection.drivers` and uses the
last one of them when initializing a new client. Sidekiq always uses `'ruby'`
(or `Redis::Connection::Ruby`) per default, though.

With this commit we are following redis' default by passing the last
loaded driver per default (or a given `:driver`).
2018-09-09 06:11:37 -07:00
Chad Schroeder
e8227186bb Raise error for duplicate queue names in config, fixes ()
* Raise error for duplicate queue names in config, fixes 

* Add note to change log
2018-08-24 11:35:07 -07:00
Jesse Reiss
e339d23036 Add CSP header to web admin to ensure it matches needs () 2018-08-05 12:31:37 -07:00