sidekiq 5.1.3 → 5.2.10
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.circleci/config.yml +61 -0
- data/.gitignore +2 -0
- data/.travis.yml +2 -5
- data/COMM-LICENSE +11 -9
- data/Changes.md +80 -0
- data/Ent-Changes.md +22 -0
- data/Gemfile +16 -5
- data/Pro-Changes.md +30 -0
- data/README.md +1 -1
- data/Rakefile +2 -1
- data/bin/sidekiqctl +13 -92
- data/bin/sidekiqload +1 -1
- data/lib/sidekiq/api.rb +50 -15
- data/lib/sidekiq/cli.rb +64 -58
- data/lib/sidekiq/client.rb +4 -3
- data/lib/sidekiq/ctl.rb +221 -0
- data/lib/sidekiq/job_logger.rb +2 -2
- data/lib/sidekiq/job_retry.rb +33 -12
- data/lib/sidekiq/launcher.rb +15 -8
- data/lib/sidekiq/manager.rb +3 -3
- data/lib/sidekiq/middleware/server/active_record.rb +1 -1
- data/lib/sidekiq/processor.rb +76 -25
- data/lib/sidekiq/rails.rb +2 -1
- data/lib/sidekiq/redis_connection.rb +20 -1
- data/lib/sidekiq/scheduled.rb +32 -3
- data/lib/sidekiq/testing.rb +4 -4
- data/lib/sidekiq/version.rb +1 -1
- data/lib/sidekiq/web/action.rb +1 -1
- data/lib/sidekiq/web/application.rb +26 -1
- data/lib/sidekiq/web/helpers.rb +13 -6
- data/lib/sidekiq/worker.rb +24 -8
- data/lib/sidekiq.rb +5 -3
- data/sidekiq.gemspec +5 -12
- data/web/assets/javascripts/application.js +0 -0
- data/web/assets/javascripts/dashboard.js +15 -5
- data/web/assets/stylesheets/application.css +35 -2
- data/web/assets/stylesheets/bootstrap.css +2 -2
- data/web/locales/ar.yml +1 -0
- data/web/locales/en.yml +1 -0
- data/web/locales/es.yml +3 -3
- data/web/views/_nav.erb +3 -17
- data/web/views/layout.erb +1 -1
- data/web/views/queue.erb +1 -0
- data/web/views/queues.erb +1 -1
- data/web/views/retries.erb +4 -0
- metadata +19 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 22b205223a123bbe3a8812f1e2804be148afb5fe91c201ecb9a073eb4a188a06
|
4
|
+
data.tar.gz: '08ab2999267df91afb8f62b9a6b00810299791cad99763d5b16f70bda946410a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad90b8ed3b060ce4521326a0dd4173550ee6bf64b0674fc08fbf37770aaec5ca0ea82738ed1730ccfcff4e0b616afcc47789ca8610cdd41a20abc0ef7d734891
|
7
|
+
data.tar.gz: 2ed367f9801d28616a1b56b0b209cfe797c2b5a137d2e67cfb8c6864c8d5ed8f58992924ddce654f1fec53b84a5f18abdf88d4df45373b98f46786d511bac3f2
|
@@ -0,0 +1,61 @@
|
|
1
|
+
version: 2
|
2
|
+
references:
|
3
|
+
unit: &unit
|
4
|
+
run:
|
5
|
+
name: Run test suite
|
6
|
+
command: bundle exec rake
|
7
|
+
restore: &restore
|
8
|
+
restore_cache:
|
9
|
+
keys:
|
10
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
11
|
+
# fallback to using the latest cache if no exact match is found
|
12
|
+
- v1-dependencies-
|
13
|
+
bundle: &bundle
|
14
|
+
run:
|
15
|
+
name: install dependencies
|
16
|
+
command: |
|
17
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
18
|
+
save: &save
|
19
|
+
save_cache:
|
20
|
+
paths:
|
21
|
+
- ./vendor/bundle
|
22
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
23
|
+
jobs:
|
24
|
+
"ruby-2.5":
|
25
|
+
docker:
|
26
|
+
- image: circleci/ruby:2.5
|
27
|
+
- image: circleci/redis:4.0
|
28
|
+
steps:
|
29
|
+
- checkout
|
30
|
+
- <<: *restore
|
31
|
+
- <<: *bundle
|
32
|
+
- <<: *save
|
33
|
+
- <<: *unit
|
34
|
+
"ruby-2.6":
|
35
|
+
docker:
|
36
|
+
- image: circleci/ruby:2.6
|
37
|
+
- image: circleci/redis:4.0
|
38
|
+
steps:
|
39
|
+
- checkout
|
40
|
+
- <<: *restore
|
41
|
+
- <<: *bundle
|
42
|
+
- <<: *save
|
43
|
+
- <<: *unit
|
44
|
+
"jruby":
|
45
|
+
docker:
|
46
|
+
- image: circleci/jruby:latest
|
47
|
+
- image: circleci/redis:4.0
|
48
|
+
steps:
|
49
|
+
- checkout
|
50
|
+
- <<: *restore
|
51
|
+
- <<: *bundle
|
52
|
+
- <<: *save
|
53
|
+
- <<: *unit
|
54
|
+
|
55
|
+
workflows:
|
56
|
+
version: 2
|
57
|
+
build:
|
58
|
+
jobs:
|
59
|
+
- "ruby-2.5"
|
60
|
+
- "ruby-2.6"
|
61
|
+
- "jruby"
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/COMM-LICENSE
CHANGED
@@ -14,13 +14,15 @@ In order to use the Software under this Agreement, you must receive a “Source
|
|
14
14
|
|
15
15
|
1.2 Unlimited Organization License. If you purchased an Organization License (included with the Sidekiq Pro Software), you may install the Software on an unlimited number of Hosts. “Host” means any physical or virtual machine which is controlled by you. You may also run an unlimited number of Workers. “Worker” means a thread within a Sidekiq server process which executes jobs. You may concurrently run the software on an unlimited number of Hosts, with each host running an unlimited number of Workers.
|
16
16
|
|
17
|
-
1.3 Limited
|
17
|
+
1.3 Limited Enterprise License. If you purchased a Limited License for the Sidekiq Enterprise Software, you may install the Software on an unlimited number of Hosts. “Host” means any physical or virtual machine which is controlled by you. The aggregate number of Workers run by the hosts must not exceed the maximum number of Workers authorized at the time of purchase. “Worker” means a thread within a Sidekiq server process which executes jobs. In order to run additional Workers, you must purchase an additional allowance from Contributed Systems.
|
18
18
|
|
19
|
-
1.4
|
19
|
+
1.4 Enterprise Site License. If you purchased a Site License for the Sidekiq Enterprise Software, you may install the Software on an unlimited number of Hosts. “Host” means any physical or virtual machine which is controlled by you. You may also run an unlimited number of Workers. “Worker” means a thread within a Sidekiq server process which executes jobs. You may concurrently run the software on an unlimited number of Hosts, with each host running an unlimited number of Workers.
|
20
20
|
|
21
|
-
1.5
|
21
|
+
1.5 Appliance License. If you purchased an Appliance License, you may distribute the Software in any applications, frameworks, or elements (collectively referred to as an “Application” or “Applications”) that you develop using the Software in accordance with this EULA, provided that such distribution does not violate the restrictions set forth in section 3 of this EULA. You must not remove, obscure or interfere with any copyright, acknowledgment, attribution, trademark, warning or disclaimer statement affixed to, incorporated in or otherwise applied in connection with the Software. You are required to ensure that the Software is not reused by or with any applications other than those with which you distribute it as permitted herein. For example, if You install the Software on a customer's server, that customer is not permitted to use the Software independently of your Application. You must inform Contributed Systems of your knowledge of any infringing use of the Software by any of your customers. You are liable for compliance by those third parties with the terms and conditions of this EULA. You will not owe Contributed Systems any royalties for your distribution of the Software in accordance with this EULA.
|
22
22
|
|
23
|
-
1.6
|
23
|
+
1.6 Archive Copies. You are entitled to make a reasonable amount of copies of the Software for archival purposes. Each copy must reproduce all copyright and other proprietary rights notices on or in the Software Product.
|
24
|
+
|
25
|
+
1.7 Electronic Delivery. All Software and license documentation shall be delivered by electronic means unless otherwise specified on the applicable invoice or at the time of purchase. Software shall be deemed delivered when it is made available for download by you (“Delivery”).
|
24
26
|
|
25
27
|
2. Modifications. Contributed Systems shall provide you with source code so that you can create Modifications of the original software. “Modification” means: (a) any addition to or deletion from the contents of a file included in the original Software or previous Modifications created by You, or (b) any new file that contains any part of the original Software or previous Modifications. While you retain all rights to any original work authored by you as part of the Modifications, We continue to own all copyright and other intellectual property rights in the Software.
|
26
28
|
|
@@ -31,7 +33,7 @@ In order to use the Software under this Agreement, you must receive a “Source
|
|
31
33
|
3.2 UNDER NO CIRCUMSTANCES MAY YOU USE THE SOFTWARE AS PART OF A PRODUCT OR SERVICE THAT PROVIDES SIMILAR FUNCTIONALITY TO THE SOFTWARE ITSELF.
|
32
34
|
|
33
35
|
The Open Source version of the Software (“LGPL Version”) is licensed
|
34
|
-
under the terms of the GNU Lesser General Public License
|
36
|
+
under the terms of the GNU Lesser General Public License version 3.0
|
35
37
|
(“LGPL”) and not under this EULA.
|
36
38
|
|
37
39
|
4. Ownership. Notwithstanding anything to the contrary contained herein, except for the limited license rights expressly provided herein, Contributed Systems and its suppliers have and will retain all rights, title and interest (including, without limitation, all patent, copyright, trademark, trade secret and other intellectual property rights) in and to the Software and all copies, modifications and derivative works thereof (including any changes which incorporate any of your ideas, feedback or suggestions). You acknowledge that you are obtaining only a limited license right to the Software, and that irrespective of any use of the words “purchase”, “sale” or like terms hereunder no ownership rights are being conveyed to you under this Agreement or otherwise.
|
@@ -42,7 +44,7 @@ under the terms of the GNU Lesser General Public License versions 3.0
|
|
42
44
|
|
43
45
|
7. Term of Agreement.
|
44
46
|
|
45
|
-
7.1 Term. This Agreement is effective as of the Delivery of the Software and expires at such time as all license and service subscriptions hereunder have expired in accordance with their own terms (the “Term”). For clarification, the term of your license under this Agreement may be perpetual, limited for Evaluation Version, or designated as a fixed-term license in the Invoice, and shall be specified at your time of purchase. Either party may terminate this Agreement (including all related Invoices) if the other party: (a) fails to cure any material breach of this Agreement within thirty (30) days after written notice of such breach, provided that Contributed Systems may terminate this Agreement immediately upon any breach of Section 3 or if you exceed any other restrictions contained in Section 1, unless otherwise specified in this agreement; (b) ceases operation without a successor; or (c) seeks protection under any bankruptcy, receivership, trust deed, creditors arrangement, composition or comparable proceeding, or if any such proceeding is instituted against such party (and not dismissed within sixty (60) days)). Termination is not an exclusive remedy and the exercise by either party of any remedy under this Agreement will be without prejudice to any other remedies it may have under this Agreement, by law, or otherwise.
|
47
|
+
7.1 Term. This Agreement is effective as of the Delivery of the Software and expires at such time as all license and service subscriptions hereunder have expired in accordance with their own terms (the “Term”). For clarification, the term of your license under this Agreement may be perpetual, limited for Evaluation Version, or designated as a fixed-term license in the Invoice, and shall be specified at your time of purchase. Either party may terminate this Agreement (including all related Invoices) if the other party: (a) fails to cure any material breach of this Agreement within thirty (30) days after written notice of such breach, provided that Contributed Systems may terminate this Agreement immediately upon any breach of Section 3 or if you exceed any other restrictions contained in Section 1, unless otherwise specified in this agreement; (b) ceases operation without a successor; or (c) seeks protection under any bankruptcy, receivership, trust deed, creditors arrangement, composition or comparable proceeding, or if any such proceeding is instituted against such party (and not dismissed within sixty (60) days)). Termination is not an exclusive remedy and the exercise by either party of any remedy under this Agreement will be without prejudice to any other remedies it may have under this Agreement, by law, or otherwise.
|
46
48
|
|
47
49
|
7.2 Termination. Upon any termination of this Agreement, you shall cease any and all use of any Software and destroy all copies thereof.
|
48
50
|
|
@@ -57,7 +59,7 @@ In no event will Contributed Systems be liable for any direct, indirect, consequ
|
|
57
59
|
|
58
60
|
In no event will Contributed Systems' liability exceed the Software license price as indicated in the invoice. The existence of more than one claim will not enlarge or extend this limit.
|
59
61
|
|
60
|
-
10. Remedies. Your exclusive remedy and Contributed Systems
|
62
|
+
10. Remedies. Your exclusive remedy and Contributed Systems' entire liability for breach of this Agreement shall be limited, at Contributed Systems' sole and exclusive discretion, to (a) replacement of any defective software or documentation; or (b) refund of the license fee paid to Contributed Systems, payable in accordance with Contributed Systems' refund policy.
|
61
63
|
|
62
64
|
11. Acknowledgements.
|
63
65
|
|
@@ -67,7 +69,7 @@ In no event will Contributed Systems' liability exceed the Software license pric
|
|
67
69
|
|
68
70
|
11.3 Government End Users. If the Software and related documentation are supplied to or purchased by or on behalf of the United States Government, then the Software is deemed to be "commercial software" as that term is used in the Federal Acquisition Regulation system. Rights of the United States shall not exceed the minimum rights set forth in FAR 52.227-19 for "restricted computer software". All other terms and conditions of this Agreement apply.
|
69
71
|
|
70
|
-
12. Third Party Software.
|
72
|
+
12. Third Party Software. Examples included in Software may provide links to third party libraries or code (collectively “Third Party Software”) to implement various functions. Third Party Software does not comprise part of the Software. In some cases, access to Third Party Software may be included along with the Software delivery as a convenience for demonstration purposes. Such source code and libraries may be included in the “…/examples” source tree delivered with the Software and do not comprise the Software. Licensee acknowledges (1) that some part of Third Party Software may require additional licensing of copyright and patents from the owners of such, and (2) that distribution of any of the Software referencing or including any portion of a Third Party Software may require appropriate licensing from such third parties.
|
71
73
|
|
72
74
|
|
73
75
|
13. Miscellaneous
|
@@ -84,7 +86,7 @@ In no event will Contributed Systems' liability exceed the Software license pric
|
|
84
86
|
|
85
87
|
13.6 Governing Law. This Agreement is governed by the laws of the State of Oregon and the United States without regard to conflicts of laws provisions thereof, and without regard to the United Nations Convention on the International Sale of Goods or the Uniform Computer Information Transactions Act, as currently enacted by any jurisdiction or as may be codified or amended from time to time by any jurisdiction. The jurisdiction and venue for actions related to the subject matter hereof shall be the state of Oregon and United States federal courts located in Portland, Oregon, and both parties hereby submit to the personal jurisdiction of such courts.
|
86
88
|
|
87
|
-
13.7 Attorneys
|
89
|
+
13.7 Attorneys' Fees and Costs. The prevailing party in any action to enforce this Agreement will be entitled to recover its attorneys' fees and costs in connection with such action.
|
88
90
|
|
89
91
|
13.8 Severability. If any provision of this Agreement is held by a court of competent jurisdiction to be invalid, illegal, or unenforceable, the remainder of this Agreement will remain in full force and effect.
|
90
92
|
|
data/Changes.md
CHANGED
@@ -2,6 +2,86 @@
|
|
2
2
|
|
3
3
|
[Sidekiq Changes](https://github.com/mperham/sidekiq/blob/master/Changes.md) | [Sidekiq Pro Changes](https://github.com/mperham/sidekiq/blob/master/Pro-Changes.md) | [Sidekiq Enterprise Changes](https://github.com/mperham/sidekiq/blob/master/Ent-Changes.md)
|
4
4
|
|
5
|
+
5.2.10
|
6
|
+
---------
|
7
|
+
|
8
|
+
- Backport fix for CVE-2022-23837.
|
9
|
+
- Migrate to `exists?` for redis-rb.
|
10
|
+
- Lock redis-rb to <4.6 to avoid deprecations.
|
11
|
+
|
12
|
+
5.2.9
|
13
|
+
---------
|
14
|
+
|
15
|
+
- Release Rack lock due to a cascade of CVEs. [#4566]
|
16
|
+
Pro-tip: don't lock Rack.
|
17
|
+
|
18
|
+
5.2.8
|
19
|
+
---------
|
20
|
+
|
21
|
+
- Lock to Rack 2.0.x to prevent future incompatibilities
|
22
|
+
- Fix invalid reference in `sidekiqctl`
|
23
|
+
|
24
|
+
5.2.7
|
25
|
+
---------
|
26
|
+
|
27
|
+
- Fix stale `enqueued_at` when retrying [#4149]
|
28
|
+
- Move build to [Circle CI](https://circleci.com/gh/mperham/sidekiq) [#4120]
|
29
|
+
|
30
|
+
5.2.6
|
31
|
+
---------
|
32
|
+
|
33
|
+
- Fix edge case where a job failure during Redis outage could result in a lost job [#4141]
|
34
|
+
- Better handling of malformed job arguments in payload [#4095]
|
35
|
+
- Restore bootstap's dropdown css component [#4099, urkle]
|
36
|
+
- Display human-friendly time diff for longer queue latencies [#4111, interlinked]
|
37
|
+
- Allow `Sidekiq::Worker#set` to be chained
|
38
|
+
|
39
|
+
5.2.5
|
40
|
+
---------
|
41
|
+
|
42
|
+
- Fix default usage of `config/sidekiq.yml` [#4077, Tensho]
|
43
|
+
|
44
|
+
5.2.4
|
45
|
+
---------
|
46
|
+
|
47
|
+
- Add warnings for various deprecations and changes coming in Sidekiq 6.0.
|
48
|
+
See the 6-0 branch. [#4056]
|
49
|
+
- Various improvements to the Sidekiq test suite and coverage [#4026, #4039, Tensho]
|
50
|
+
|
51
|
+
5.2.3
|
52
|
+
---------
|
53
|
+
|
54
|
+
- Warning message on invalid REDIS\_PROVIDER [#3970]
|
55
|
+
- Add `sidekiqctl status` command [#4003, dzunk]
|
56
|
+
- Update elapsed time calculatons to use monotonic clock [#3999]
|
57
|
+
- Fix a few issues with mobile Web UI styling [#3973, navied]
|
58
|
+
- Jobs with `retry: false` now go through the global `death_handlers`,
|
59
|
+
meaning you can take action on failed ephemeral jobs. [#3980, Benjamin-Dobell]
|
60
|
+
- Fix race condition in defining Workers. [#3997, mattbooks]
|
61
|
+
|
62
|
+
5.2.2
|
63
|
+
---------
|
64
|
+
|
65
|
+
- Raise error for duplicate queue names in config to avoid unexpected fetch algorithm change [#3911]
|
66
|
+
- Fix concurrency bug on JRuby [#3958, mattbooks]
|
67
|
+
- Add "Kill All" button to the retries page [#3938]
|
68
|
+
|
69
|
+
5.2.1
|
70
|
+
-----------
|
71
|
+
|
72
|
+
- Fix concurrent modification error during heartbeat [#3921]
|
73
|
+
|
74
|
+
5.2.0
|
75
|
+
-----------
|
76
|
+
|
77
|
+
- **Decrease default concurrency from 25 to 10** [#3892]
|
78
|
+
- Verify connection pool sizing upon startup [#3917]
|
79
|
+
- Smoother scheduling for large Sidekiq clusters [#3889]
|
80
|
+
- Switch Sidekiq::Testing impl from alias\_method to Module#prepend, for resiliency [#3852]
|
81
|
+
- Update Sidekiq APIs to use SCAN for scalability [#3848, ffiller]
|
82
|
+
- Remove concurrent-ruby gem dependency [#3830]
|
83
|
+
- Optimize Web UI's bootstrap.css [#3914]
|
84
|
+
|
5
85
|
5.1.3
|
6
86
|
-----------
|
7
87
|
|
data/Ent-Changes.md
CHANGED
@@ -4,6 +4,28 @@
|
|
4
4
|
|
5
5
|
Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
|
6
6
|
|
7
|
+
1.8.1
|
8
|
+
-------------
|
9
|
+
|
10
|
+
- Fix excessive lock reclaims with concurrent limiter [#4105]
|
11
|
+
- Add ES translations, see issues [#3949](https://github.com/mperham/sidekiq/issues/3949) and [#3951](https://github.com/mperham/sidekiq/issues/3951) to add your own language.
|
12
|
+
|
13
|
+
1.8.0
|
14
|
+
-------------
|
15
|
+
|
16
|
+
- Require Sidekiq Pro 4.0 and Sidekiq 5.2.
|
17
|
+
- Refactor historical metrics API to use revamped Statsd support in Sidekiq Pro
|
18
|
+
- Add a gauge to historical metrics for `default` queue latency [#4079]
|
19
|
+
|
20
|
+
1.7.2
|
21
|
+
-------------
|
22
|
+
|
23
|
+
- Add PT and JA translations
|
24
|
+
- Fix elapsed time calculations to use monotonic clock [#4000, sj26]
|
25
|
+
- Fix edge case where flapping leadership would cause old periodic
|
26
|
+
jobs to be fired once [#3974]
|
27
|
+
- Add support for sidekiqswarm memory monitoring on FreeBSD [#3884]
|
28
|
+
|
7
29
|
1.7.1
|
8
30
|
-------------
|
9
31
|
|
data/Gemfile
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
+
|
2
3
|
gemspec
|
3
4
|
|
4
|
-
gem '
|
5
|
-
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
|
5
|
+
gem 'rake'
|
6
|
+
gem 'redis-namespace'
|
7
|
+
gem 'rails', '~> 5.2'
|
8
|
+
gem 'sqlite3', platforms: :ruby
|
9
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
10
|
+
|
11
|
+
group :test do
|
12
|
+
gem 'minitest'
|
13
|
+
gem 'simplecov'
|
14
|
+
end
|
15
|
+
|
16
|
+
group :load_test do
|
17
|
+
gem 'hiredis'
|
18
|
+
gem 'toxiproxy'
|
19
|
+
end
|
data/Pro-Changes.md
CHANGED
@@ -4,6 +4,35 @@
|
|
4
4
|
|
5
5
|
Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
|
6
6
|
|
7
|
+
HEAD
|
8
|
+
---------
|
9
|
+
|
10
|
+
- Add ES translations, see issues [#3949](https://github.com/mperham/sidekiq/issues/3949) and [#3951](https://github.com/mperham/sidekiq/issues/3951) to add your own language.
|
11
|
+
|
12
|
+
4.0.5
|
13
|
+
---------
|
14
|
+
|
15
|
+
- Increase super\_fetch retriever thread count from 1 to 2 to make it
|
16
|
+
less sensitive to Redis latency.
|
17
|
+
- Better handling of invalid job JSON by reliable scheduler [#4053]
|
18
|
+
- Added ZH, PT, JA and RU translations.
|
19
|
+
|
20
|
+
4.0.4
|
21
|
+
---------
|
22
|
+
|
23
|
+
- Update Sidekiq::Client patches to work with new Module#prepend
|
24
|
+
mechanism in Sidekiq 5.2.0. [#3930]
|
25
|
+
|
26
|
+
4.0.3
|
27
|
+
---------
|
28
|
+
|
29
|
+
- Add at\_exit handler to push any saved jobs in `reliable_push` when exiting. [#3823]
|
30
|
+
- Implement batch death callback. This is fired the first time a job within a batch dies. [#3841]
|
31
|
+
```ruby
|
32
|
+
batch = Sidekiq::Batch.new
|
33
|
+
batch.on(:death, ...)
|
34
|
+
```
|
35
|
+
|
7
36
|
4.0.2
|
8
37
|
---------
|
9
38
|
|
@@ -16,6 +45,7 @@ Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how t
|
|
16
45
|
---------
|
17
46
|
|
18
47
|
- Fix incompatibility with the statsd-ruby gem [#3740]
|
48
|
+
- Add tags to Statsd metrics when using Datadog [#3744]
|
19
49
|
|
20
50
|
4.0.0
|
21
51
|
---------
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Sidekiq
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq)
|
6
|
-
[![Build Status](https://
|
6
|
+
[![Build Status](https://circleci.com/gh/mperham/sidekiq/tree/master.svg?style=svg)](https://circleci.com/gh/mperham/sidekiq/tree/master)
|
7
7
|
[![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)
|
8
8
|
|
9
9
|
|
data/Rakefile
CHANGED
data/bin/sidekiqctl
CHANGED
@@ -1,99 +1,20 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'fileutils'
|
4
|
+
require 'sidekiq/api'
|
5
|
+
require 'sidekiq/ctl'
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
attr_reader :stage, :pidfile, :kill_timeout
|
9
|
-
|
10
|
-
def self.print_usage
|
11
|
-
puts "#{File.basename($0)} - stop a Sidekiq process from the command line."
|
12
|
-
puts
|
13
|
-
puts "Usage: #{File.basename($0)} <command> <pidfile> <kill_timeout>"
|
14
|
-
puts " where <command> is either 'quiet' or 'stop'"
|
15
|
-
puts " <pidfile> is path to a pidfile"
|
16
|
-
puts " <kill_timeout> is number of seconds to wait until Sidekiq exits"
|
17
|
-
puts " (default: #{Sidekiqctl::DEFAULT_KILL_TIMEOUT}), after which Sidekiq will be KILL'd"
|
18
|
-
puts
|
19
|
-
puts "Be sure to set the kill_timeout LONGER than Sidekiq's -t timeout. If you want"
|
20
|
-
puts "to wait 60 seconds for jobs to finish, use `sidekiq -t 60` and `sidekiqctl stop"
|
21
|
-
puts " path_to_pidfile 61`"
|
22
|
-
puts
|
23
|
-
end
|
24
|
-
|
25
|
-
def initialize(stage, pidfile, timeout)
|
26
|
-
@stage = stage
|
27
|
-
@pidfile = pidfile
|
28
|
-
@kill_timeout = timeout
|
29
|
-
|
30
|
-
done('No pidfile given', :error) if !pidfile
|
31
|
-
done("Pidfile #{pidfile} does not exist", :warn) if !File.exist?(pidfile)
|
32
|
-
done('Invalid pidfile content', :error) if pid == 0
|
33
|
-
|
34
|
-
fetch_process
|
35
|
-
|
36
|
-
begin
|
37
|
-
send(stage)
|
38
|
-
rescue NoMethodError
|
39
|
-
done "Invalid command: #{stage}", :error
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def fetch_process
|
44
|
-
Process.kill(0, pid)
|
45
|
-
rescue Errno::ESRCH
|
46
|
-
done "Process doesn't exist", :error
|
47
|
-
# We were not allowed to send a signal, but the process must have existed
|
48
|
-
# when Process.kill() was called.
|
49
|
-
rescue Errno::EPERM
|
50
|
-
return pid
|
51
|
-
end
|
52
|
-
|
53
|
-
def done(msg, error = nil)
|
54
|
-
puts msg
|
55
|
-
exit(exit_signal(error))
|
56
|
-
end
|
57
|
-
|
58
|
-
def exit_signal(error)
|
59
|
-
(error == :error) ? 1 : 0
|
60
|
-
end
|
61
|
-
|
62
|
-
def pid
|
63
|
-
@pid ||= File.read(pidfile).to_i
|
64
|
-
end
|
65
|
-
|
66
|
-
def quiet
|
67
|
-
`kill -TSTP #{pid}`
|
68
|
-
end
|
69
|
-
|
70
|
-
def stop
|
71
|
-
`kill -TERM #{pid}`
|
72
|
-
kill_timeout.times do
|
73
|
-
begin
|
74
|
-
Process.kill(0, pid)
|
75
|
-
rescue Errno::ESRCH
|
76
|
-
FileUtils.rm_f pidfile
|
77
|
-
done 'Sidekiq shut down gracefully.'
|
78
|
-
rescue Errno::EPERM
|
79
|
-
done 'Not permitted to shut down Sidekiq.'
|
80
|
-
end
|
81
|
-
sleep 1
|
82
|
-
end
|
83
|
-
`kill -9 #{pid}`
|
84
|
-
FileUtils.rm_f pidfile
|
85
|
-
done 'Sidekiq shut down forcefully.'
|
86
|
-
end
|
87
|
-
alias_method :shutdown, :stop
|
88
|
-
end
|
89
|
-
|
90
|
-
if ARGV.length < 2
|
91
|
-
Sidekiqctl.print_usage
|
7
|
+
if ARGV[0] == 'status'
|
8
|
+
Sidekiq::Ctl::Status.new.display(ARGV[1])
|
92
9
|
else
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
10
|
+
if ARGV.length < 2
|
11
|
+
Sidekiq::Ctl.print_usage
|
12
|
+
else
|
13
|
+
stage = ARGV[0]
|
14
|
+
pidfile = ARGV[1]
|
15
|
+
timeout = ARGV[2].to_i
|
16
|
+
timeout = Sidekiq::Ctl::DEFAULT_KILL_TIMEOUT if timeout == 0
|
97
17
|
|
98
|
-
|
18
|
+
Sidekiq::Ctl.new(stage, pidfile, timeout)
|
19
|
+
end
|
99
20
|
end
|
data/bin/sidekiqload
CHANGED
@@ -65,7 +65,7 @@ def handle_signal(launcher, sig)
|
|
65
65
|
# http://jira.codehaus.org/browse/JRUBY-4637
|
66
66
|
raise Interrupt
|
67
67
|
when 'TERM'
|
68
|
-
# Heroku sends TERM and then waits
|
68
|
+
# Heroku sends TERM and then waits 30 seconds for process to exit.
|
69
69
|
raise Interrupt
|
70
70
|
when 'TSTP'
|
71
71
|
Sidekiq.logger.info "Received TSTP, no longer accepting new work"
|