sidekiq 4.0.0 → 5.0.0

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.

Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/{Contributing.md → .github/contributing.md} +0 -0
  3. data/.github/issue_template.md +9 -0
  4. data/.gitignore +1 -0
  5. data/.travis.yml +12 -10
  6. data/4.0-Upgrade.md +4 -1
  7. data/5.0-Upgrade.md +56 -0
  8. data/COMM-LICENSE +1 -1
  9. data/Changes.md +236 -7
  10. data/Ent-Changes.md +111 -3
  11. data/Gemfile +7 -6
  12. data/Pro-3.0-Upgrade.md +5 -7
  13. data/Pro-Changes.md +162 -5
  14. data/README.md +31 -21
  15. data/Rakefile +5 -2
  16. data/bin/sidekiq +0 -1
  17. data/bin/sidekiqctl +1 -1
  18. data/bin/sidekiqload +15 -33
  19. data/code_of_conduct.md +50 -0
  20. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +2 -2
  21. data/lib/generators/sidekiq/templates/worker_test.rb.erb +6 -6
  22. data/lib/sidekiq.rb +46 -21
  23. data/lib/sidekiq/api.rb +94 -30
  24. data/lib/sidekiq/cli.rb +38 -16
  25. data/lib/sidekiq/client.rb +32 -26
  26. data/lib/sidekiq/core_ext.rb +14 -0
  27. data/lib/sidekiq/delay.rb +21 -0
  28. data/lib/sidekiq/exception_handler.rb +2 -1
  29. data/lib/sidekiq/extensions/action_mailer.rb +1 -0
  30. data/lib/sidekiq/extensions/active_record.rb +1 -0
  31. data/lib/sidekiq/extensions/class_methods.rb +1 -0
  32. data/lib/sidekiq/extensions/generic_proxy.rb +8 -1
  33. data/lib/sidekiq/fetch.rb +2 -1
  34. data/lib/sidekiq/job_logger.rb +27 -0
  35. data/lib/sidekiq/job_retry.rb +235 -0
  36. data/lib/sidekiq/launcher.rb +42 -33
  37. data/lib/sidekiq/logging.rb +3 -1
  38. data/lib/sidekiq/manager.rb +9 -4
  39. data/lib/sidekiq/middleware/chain.rb +1 -0
  40. data/lib/sidekiq/middleware/i18n.rb +1 -0
  41. data/lib/sidekiq/middleware/server/active_record.rb +9 -0
  42. data/lib/sidekiq/paginator.rb +1 -0
  43. data/lib/sidekiq/processor.rb +73 -19
  44. data/lib/sidekiq/rails.rb +47 -25
  45. data/lib/sidekiq/redis_connection.rb +14 -3
  46. data/lib/sidekiq/scheduled.rb +12 -1
  47. data/lib/sidekiq/testing.rb +65 -13
  48. data/lib/sidekiq/testing/inline.rb +1 -0
  49. data/lib/sidekiq/util.rb +3 -15
  50. data/lib/sidekiq/version.rb +2 -1
  51. data/lib/sidekiq/web.rb +120 -184
  52. data/lib/sidekiq/web/action.rb +89 -0
  53. data/lib/sidekiq/web/application.rb +331 -0
  54. data/lib/sidekiq/{web_helpers.rb → web/helpers.rb} +57 -27
  55. data/lib/sidekiq/web/router.rb +100 -0
  56. data/lib/sidekiq/worker.rb +52 -11
  57. data/sidekiq.gemspec +12 -7
  58. data/web/assets/images/{status-sd8051fd480.png → status.png} +0 -0
  59. data/web/assets/javascripts/application.js +24 -20
  60. data/web/assets/javascripts/dashboard.js +11 -13
  61. data/web/assets/stylesheets/application-rtl.css +246 -0
  62. data/web/assets/stylesheets/application.css +362 -5
  63. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  64. data/web/assets/stylesheets/bootstrap.css +4 -8
  65. data/web/locales/ar.yml +80 -0
  66. data/web/locales/cs.yml +11 -1
  67. data/web/locales/de.yml +1 -1
  68. data/web/locales/en.yml +2 -0
  69. data/web/locales/fa.yml +80 -0
  70. data/web/locales/fr.yml +21 -12
  71. data/web/locales/he.yml +79 -0
  72. data/web/locales/ja.yml +19 -10
  73. data/web/locales/ru.yml +3 -0
  74. data/web/locales/ur.yml +80 -0
  75. data/web/views/_footer.erb +2 -2
  76. data/web/views/_job_info.erb +5 -1
  77. data/web/views/_nav.erb +2 -2
  78. data/web/views/_paging.erb +1 -1
  79. data/web/views/busy.erb +14 -9
  80. data/web/views/dashboard.erb +5 -5
  81. data/web/views/dead.erb +1 -1
  82. data/web/views/layout.erb +13 -5
  83. data/web/views/morgue.erb +16 -12
  84. data/web/views/queue.erb +11 -11
  85. data/web/views/queues.erb +3 -3
  86. data/web/views/retries.erb +15 -13
  87. data/web/views/retry.erb +2 -2
  88. data/web/views/scheduled.erb +4 -4
  89. data/web/views/scheduled_job_info.erb +1 -1
  90. metadata +97 -148
  91. data/lib/sidekiq/middleware/server/logging.rb +0 -40
  92. data/lib/sidekiq/middleware/server/retry_jobs.rb +0 -206
  93. data/test/config.yml +0 -9
  94. data/test/env_based_config.yml +0 -11
  95. data/test/fake_env.rb +0 -0
  96. data/test/fixtures/en.yml +0 -2
  97. data/test/helper.rb +0 -74
  98. data/test/test_actors.rb +0 -137
  99. data/test/test_api.rb +0 -494
  100. data/test/test_cli.rb +0 -335
  101. data/test/test_client.rb +0 -194
  102. data/test/test_exception_handler.rb +0 -55
  103. data/test/test_extensions.rb +0 -126
  104. data/test/test_fetch.rb +0 -49
  105. data/test/test_launcher.rb +0 -80
  106. data/test/test_logging.rb +0 -34
  107. data/test/test_manager.rb +0 -49
  108. data/test/test_middleware.rb +0 -157
  109. data/test/test_processor.rb +0 -200
  110. data/test/test_rails.rb +0 -21
  111. data/test/test_redis_connection.rb +0 -126
  112. data/test/test_retry.rb +0 -325
  113. data/test/test_scheduled.rb +0 -114
  114. data/test/test_scheduling.rb +0 -49
  115. data/test/test_sidekiq.rb +0 -99
  116. data/test/test_testing.rb +0 -142
  117. data/test/test_testing_fake.rb +0 -331
  118. data/test/test_testing_inline.rb +0 -93
  119. data/test/test_util.rb +0 -16
  120. data/test/test_web.rb +0 -608
  121. data/test/test_web_helpers.rb +0 -53
  122. data/web/assets/images/bootstrap/glyphicons-halflings-white.png +0 -0
  123. data/web/assets/images/bootstrap/glyphicons-halflings.png +0 -0
  124. data/web/assets/images/status/active.png +0 -0
  125. data/web/assets/images/status/idle.png +0 -0
  126. data/web/assets/javascripts/locales/README.md +0 -27
  127. data/web/assets/javascripts/locales/jquery.timeago.ar.js +0 -96
  128. data/web/assets/javascripts/locales/jquery.timeago.bg.js +0 -18
  129. data/web/assets/javascripts/locales/jquery.timeago.bs.js +0 -49
  130. data/web/assets/javascripts/locales/jquery.timeago.ca.js +0 -18
  131. data/web/assets/javascripts/locales/jquery.timeago.cs.js +0 -18
  132. data/web/assets/javascripts/locales/jquery.timeago.cy.js +0 -20
  133. data/web/assets/javascripts/locales/jquery.timeago.da.js +0 -18
  134. data/web/assets/javascripts/locales/jquery.timeago.de.js +0 -18
  135. data/web/assets/javascripts/locales/jquery.timeago.el.js +0 -18
  136. data/web/assets/javascripts/locales/jquery.timeago.en-short.js +0 -20
  137. data/web/assets/javascripts/locales/jquery.timeago.en.js +0 -20
  138. data/web/assets/javascripts/locales/jquery.timeago.es.js +0 -18
  139. data/web/assets/javascripts/locales/jquery.timeago.et.js +0 -18
  140. data/web/assets/javascripts/locales/jquery.timeago.fa.js +0 -22
  141. data/web/assets/javascripts/locales/jquery.timeago.fi.js +0 -28
  142. data/web/assets/javascripts/locales/jquery.timeago.fr-short.js +0 -16
  143. data/web/assets/javascripts/locales/jquery.timeago.fr.js +0 -17
  144. data/web/assets/javascripts/locales/jquery.timeago.he.js +0 -18
  145. data/web/assets/javascripts/locales/jquery.timeago.hr.js +0 -49
  146. data/web/assets/javascripts/locales/jquery.timeago.hu.js +0 -18
  147. data/web/assets/javascripts/locales/jquery.timeago.hy.js +0 -18
  148. data/web/assets/javascripts/locales/jquery.timeago.id.js +0 -18
  149. data/web/assets/javascripts/locales/jquery.timeago.it.js +0 -16
  150. data/web/assets/javascripts/locales/jquery.timeago.ja.js +0 -19
  151. data/web/assets/javascripts/locales/jquery.timeago.ko.js +0 -17
  152. data/web/assets/javascripts/locales/jquery.timeago.lt.js +0 -20
  153. data/web/assets/javascripts/locales/jquery.timeago.mk.js +0 -20
  154. data/web/assets/javascripts/locales/jquery.timeago.nl.js +0 -20
  155. data/web/assets/javascripts/locales/jquery.timeago.no.js +0 -18
  156. data/web/assets/javascripts/locales/jquery.timeago.pl.js +0 -31
  157. data/web/assets/javascripts/locales/jquery.timeago.pt-br.js +0 -16
  158. data/web/assets/javascripts/locales/jquery.timeago.pt.js +0 -16
  159. data/web/assets/javascripts/locales/jquery.timeago.ro.js +0 -18
  160. data/web/assets/javascripts/locales/jquery.timeago.rs.js +0 -49
  161. data/web/assets/javascripts/locales/jquery.timeago.ru.js +0 -34
  162. data/web/assets/javascripts/locales/jquery.timeago.sk.js +0 -18
  163. data/web/assets/javascripts/locales/jquery.timeago.sl.js +0 -44
  164. data/web/assets/javascripts/locales/jquery.timeago.sv.js +0 -18
  165. data/web/assets/javascripts/locales/jquery.timeago.th.js +0 -20
  166. data/web/assets/javascripts/locales/jquery.timeago.tr.js +0 -16
  167. data/web/assets/javascripts/locales/jquery.timeago.uk.js +0 -34
  168. data/web/assets/javascripts/locales/jquery.timeago.uz.js +0 -19
  169. data/web/assets/javascripts/locales/jquery.timeago.zh-cn.js +0 -20
  170. data/web/assets/javascripts/locales/jquery.timeago.zh-tw.js +0 -20
  171. data/web/views/_poll_js.erb +0 -5
data/Gemfile CHANGED
@@ -1,10 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'rails', '~> 4.2'
4
+ gem 'rails', '>= 5.0.1'
5
+ gem "hiredis"
5
6
  gem 'simplecov'
6
7
  gem 'minitest'
7
- gem 'minitest-utils'
8
+ #gem 'minitest-utils'
8
9
  gem 'toxiproxy'
9
10
 
10
11
  platforms :rbx do
@@ -22,7 +23,7 @@ platforms :mri do
22
23
  gem 'ruby-prof'
23
24
  end
24
25
 
25
- platforms :jruby do
26
- gem 'jruby-openssl'
27
- gem 'activerecord-jdbcsqlite3-adapter'
28
- end
26
+ #platforms :jruby do
27
+ #gem 'jruby-openssl'
28
+ #gem 'activerecord-jdbcsqlite3-adapter'
29
+ #end
@@ -17,17 +17,15 @@ Sidekiq Pro 3.0 is designed to work with Sidekiq 4.0.
17
17
  * Reliable fetch has been re-implemented due to the fetch changes in
18
18
  Sidekiq 4.0.
19
19
 
20
- * Support for platforms without persistent hostnames. Since reliable fetch
21
- normally requires a persistent hostname, you may disable hostname usage on
22
- platforms like Heroku and Docker:
20
+ * Support for platforms without persistent hostnames. Since the reliable\_fetch
21
+ algorithm requires a persistent hostname, an alternative reliability
22
+ algorithm is now available for platforms like Heroku and Docker:
23
23
  ```ruby
24
24
  Sidekiq.configure_server do |config|
25
- config.options[:ephemeral_hostname] = true
26
- config.reliable_fetch!
25
+ config.timed_fetch!
27
26
  end
28
27
  ```
29
- This option is enabled automatically if Heroku's DYNO environment variable is present.
30
- Without a persistent hostname, each Sidekiq process **must** have its own unique index.
28
+ The wiki contains [much more detail about each reliability option](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server).
31
29
 
32
30
  * The old 'sidekiq/notifications' features have been removed.
33
31
 
@@ -1,14 +1,171 @@
1
- Sidekiq Pro Changelog
2
- =======================
1
+ # Sidekiq Pro Changelog
2
+
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)
3
4
 
4
5
  Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
5
6
 
6
- 3.0.0.pre2
7
+ HEAD
8
+ ---------
9
+
10
+ - Re-implement `Sidekiq::Queue#delete_job` to avoid O(n) runtime [#3408]
11
+ - Batch page displays Pending JIDs if less than 10 [#3130]
12
+ - Batch page has a Search button to find associated Retries [#3130]
13
+ - Make Batch UI progress bar more friendly to the colorblind [#3387]
14
+
15
+ 3.4.5
16
+ ---------
17
+
18
+ - Fix potential job loss with reliable scheduler when lots of jobs are scheduled
19
+ at precisely the same time. Thanks to raivil for his hard work in
20
+ reproducing the bug. [#3371]
21
+
22
+ 3.4.4
23
+ ---------
24
+
25
+ - Optimize super\_fetch shutdown to restart jobs quicker [#3249]
26
+
27
+ 3.4.3
28
+ ---------
29
+
30
+ - Limit reliable scheduler to enqueue up to 100 jobs per call, minimizing Redis latency [#3332]
31
+ - Fix bug in super\_fetch logic for queues with `_` in the name [#3339]
32
+
33
+ 3.4.2
34
+ ---------
35
+
36
+ - Add `Batch::Status#invalidated?` API which returns true if any/all
37
+ JIDs were invalidated within the batch. [#3326]
38
+
39
+ 3.4.1
40
+ ---------
41
+
42
+ - Allow super\_fetch's orphan job check to happen as often as every hour [#3273]
43
+ - Officially deprecate reliable\_fetch algorithm, I now recommend you use `super_fetch` instead:
44
+ ```ruby
45
+ Sidekiq.configure_server do |config|
46
+ config.super_fetch!
47
+ end
48
+ ```
49
+ Also note that Sidekiq's `-i/--index` option is no longer used/relevant with super\_fetch.
50
+ - Don't display "Delete/Retry All" buttons when filtering in Web UI [#3243]
51
+ - Reimplement Sidekiq::JobSet#find\_job with ZSCAN [#3197]
52
+
53
+ 3.4.0
54
+ ---------
55
+
56
+ - Introducing the newest reliable fetching algorithm: `super_fetch`! This
57
+ algorithm will replace reliable\_fetch in Pro 4.0. super\_fetch is
58
+ bullet-proof across all environments, no longer requiring stable
59
+ hostnames or an index to be set per-process. [#3077]
60
+ ```ruby
61
+ Sidekiq.configure_server do |config|
62
+ config.super_fetch!
63
+ end
64
+ ```
65
+ Thank you to @jonhyman for code review and the Sidekiq Pro customers that
66
+ beta tested super\_fetch.
67
+
68
+ 3.3.3
69
+ ---------
70
+
71
+ - Update Web UI extension to work with Sidekiq 4.2.0's new Web UI. [#3075]
72
+
73
+ 3.3.2
74
+ ---------
75
+
76
+ - Minimize batch memory usage after success [#3083]
77
+ - Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
78
+
79
+ 3.3.1
80
+ ---------
81
+
82
+ - If environment is unset, treat it as development so reliable\_fetch works as before 3.2.2.
83
+
84
+ 3.3.0
85
+ ---------
86
+
87
+ - Don't delete batches immediately upon success but set a 24 hr expiry, this allows
88
+ Sidekiq::Batch::Status#poll to work, even after batch success. [#3011]
89
+ - New `Sidekiq::PendingSet#destroy(jid)` API to remove poison pill jobs [#3015]
90
+
91
+ 3.2.2
92
+ ---------
93
+
94
+ - A default value for -i is only set in development now, staging or
95
+ other environments must set an index if you wish to use reliable\_fetch. [#2971]
96
+ - Fix nil dereference when checking for jobs over timeout in timed\_fetch
97
+
98
+
99
+ 3.2.1
100
+ ---------
101
+
102
+ - timed\_fetch now works with namespaces. [ryansch]
103
+
104
+
105
+ 3.2.0
106
+ ---------
107
+
108
+ - Fixed detection of missing batches, `NoSuchBatch` should be raised
109
+ properly now if `Sidekiq::Batch.new(bid)` is called on a batch no
110
+ longer in Redis.
111
+ - Remove support for Pro 1.x format batches. This version will no
112
+ longer seamlessly process batches created with Sidekiq Pro 1.x.
113
+ As always, upgrade one major version at a time to ensure a smooth
114
+ transition.
115
+ - Fix edge case where a parent batch could expire before a child batch
116
+ was finished processing, leading to missing batches [#2889]
117
+
118
+ 2.1.5
119
+ ---------
120
+
121
+ - Fix edge case where a parent batch could expire before a child batch
122
+ was finished processing, leading to missing batches [#2889]
123
+
124
+ 3.1.0
125
+ ---------
126
+
127
+ - New container-friendly fetch algorithm: `timed_fetch`. See the
128
+ [wiki documentation](https://github.com/mperham/sidekiq/wiki/Pro-Reliability-Server)
129
+ for trade offs between the two reliability options. You should
130
+ use this if you are on Heroku, Docker, Amazon ECS or EBS or
131
+ another container-based system.
132
+
133
+
134
+ 3.0.6
135
+ ---------
136
+
137
+ - Fix race condition on reliable fetch shutdown
138
+
139
+ 3.0.5
140
+ ---------
141
+
142
+ - Statsd metrics now account for ActiveJob class names
143
+ - Allow reliable fetch internals to be overridden [jonhyman]
144
+
145
+ 3.0.4
146
+ ---------
147
+
148
+ - Queue pausing no longer requires reliable fetch. [#2786]
149
+
150
+ 3.0.3, 2.1.4
151
+ ------------
152
+
153
+ - Convert Lua-based `Sidekiq::Queue#delete_by_class` to Ruby-based, to
154
+ avoid O(N^2) performance and possible Redis failure. [#2806]
155
+
156
+ 3.0.2
157
+ -----------
158
+
159
+ - Make job registration with batch part of the atomic push so batch
160
+ metadata can't get out of sync with the job data. [#2714]
161
+
162
+ 3.0.1
7
163
  -----------
8
164
 
9
- - Fix excessive connection usage by reliable fetch.
165
+ - Remove a number of Redis version checks since we can assume 2.8+ now.
166
+ - Fix expiring jobs client middleware not loaded on server
10
167
 
11
- 3.0.0.pre1
168
+ 3.0.0
12
169
  -----------
13
170
 
14
171
  - See the [Pro 3.0 release notes](Pro-3.0-Upgrade.md).
data/README.md CHANGED
@@ -11,28 +11,33 @@ Simple, efficient background processing for Ruby.
11
11
 
12
12
  Sidekiq uses threads to handle many jobs at the same time in the
13
13
  same process. It does not require Rails but will integrate tightly with
14
- Rails 3/4 to make background processing dead simple.
14
+ Rails to make background processing dead simple.
15
15
 
16
16
  Sidekiq is compatible with Resque. It uses the exact same
17
17
  message format as Resque so it can integrate into an existing Resque processing farm.
18
18
  You can have Sidekiq and Resque run side-by-side at the same time and
19
19
  use the Resque client to enqueue jobs in Redis to be processed by Sidekiq.
20
20
 
21
- At the same time, Sidekiq uses multithreading so it is much more memory efficient than
22
- Resque (which forks a new process for every job). You'll find that you might need
23
- 10 200MB resque processes to peg your CPU whereas one 300MB Sidekiq process will peg
24
- the same CPU and perform the same amount of work.
21
+ Performance
22
+ ---------------
23
+
24
+ Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput
25
+ -----------------|------|---------|---------|------------------------
26
+ Sidekiq 4.0.0 | 10ms | 151 MB | 22 sec | **4500 jobs/sec**
27
+ Sidekiq 3.5.1 | 22ms | 1257 MB | 125 sec | 800 jobs/sec
28
+ Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec
29
+ DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec
25
30
 
26
31
 
27
32
  Requirements
28
33
  -----------------
29
34
 
30
- I test with the latest MRI (2.2, 2.1 and 2.0) and JRuby versions (1.7). Other versions/VMs
31
- are untested but might work fine. MRI 1.9 is no longer supported.
35
+ Sidekiq supports CRuby 2.2.2+ and JRuby 9k.
32
36
 
33
- All Rails releases starting from 3.2 are officially supported.
37
+ All Rails releases >= 4.0 are officially supported.
34
38
 
35
- Redis 2.8 or greater is required.
39
+ Redis 2.8 or greater is required. 3.0.3+ is recommended for large
40
+ installations with thousands of worker threads.
36
41
 
37
42
 
38
43
  Installation
@@ -45,7 +50,8 @@ Getting Started
45
50
  -----------------
46
51
 
47
52
  See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
48
- You can watch [Railscast #366](http://railscasts.com/episodes/366-sidekiq) to see Sidekiq in action. If you do everything right, you should see this:
53
+ You can watch [this Youtube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
54
+ Sidekiq and see its features in action. Here's the Web UI:
49
55
 
50
56
  ![Web UI](https://github.com/mperham/sidekiq/raw/master/examples/web-ui.png)
51
57
 
@@ -58,15 +64,8 @@ features, a commercial-friendly license and allow you to support high
58
64
  quality open source development all at the same time. Please see the
59
65
  [Sidekiq](http://sidekiq.org/) homepage for more detail.
60
66
 
61
-
62
- More Information
63
- -----------------
64
-
65
- Please see the [sidekiq wiki](https://github.com/mperham/sidekiq/wiki) for the official documentation.
66
- [mperham/sidekiq on Gitter](https://gitter.im/mperham/sidekiq) is dedicated to this project,
67
- but bug reports or feature requests suggestions should still go through [issues on Github](https://github.com/mperham/sidekiq/issues). Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
68
-
69
- You may also find useful a [Reddit area](https://reddit.com/r/sidekiq) dedicated to Sidekiq discussion and [a Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow.
67
+ Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
68
+ features and changes to Sidekiq and its bigger siblings.
70
69
 
71
70
 
72
71
  Problems?
@@ -74,9 +73,20 @@ Problems?
74
73
 
75
74
  **Please do not directly email any Sidekiq committers with questions or problems.** A community is best served when discussions are held in public.
76
75
 
77
- If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages. Searching the issues for your problem is also a good idea. If that doesn't help, feel free to email the Sidekiq mailing list, chat in Gitter, or open a new issue.
78
- StackOverflow or Reddit is the preferred place to ask questions on usage. If you are encountering what you think is a bug, please open an issue.
76
+ If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
77
+ Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
78
+
79
+ Useful resources:
80
+
81
+ * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
82
+ * Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
83
+ * Here's a [Reddit forum](https://reddit.com/r/sidekiq) dedicated to Sidekiq discussion
84
+ * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q & A.
85
+
86
+ **No support via Twitter, 140 characters is not enough.**
79
87
 
88
+ Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
89
+ See the [Sidekiq support page](http://sidekiq.org/support) for details.
80
90
 
81
91
  Thanks
82
92
  -----------------
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
3
  Rake::TestTask.new(:test) do |test|
4
- #SO MUCH NOISE
5
- #test.warning = true
4
+ test.warning = true
6
5
  test.pattern = 'test/**/test_*.rb'
7
6
  end
8
7
 
9
8
  task :default => :test
9
+
10
+ task :appraise do
11
+ exec("cd myapp && rake appraise")
12
+ end
@@ -3,7 +3,6 @@
3
3
  # Quiet some warnings we see when running in warning mode:
4
4
  # RUBYOPT=-w bundle exec sidekiq
5
5
  $TESTING = false
6
- $CELLULOID_DEBUG = false
7
6
 
8
7
  require_relative '../lib/sidekiq/cli'
9
8
 
@@ -64,7 +64,7 @@ class Sidekiqctl
64
64
  end
65
65
 
66
66
  def quiet
67
- `kill -USR1 #{pid}`
67
+ `kill -TSTP #{pid}`
68
68
  end
69
69
 
70
70
  def stop
@@ -12,22 +12,9 @@ require_relative '../lib/sidekiq/launcher'
12
12
 
13
13
  include Sidekiq::Util
14
14
 
15
- # brew tap shopify/shopify
16
- # brew install toxiproxy
17
- # gem install toxiproxy
18
- require 'toxiproxy'
19
- # simulate a non-localhost network for realer-world conditions.
20
- # adding 1ms of network latency has an ENORMOUS impact on benchmarks
21
- Toxiproxy.populate([{
22
- "name": "redis",
23
- "listen": "127.0.0.1:6380",
24
- "upstream": "127.0.0.1:6379"
25
- }])
26
-
27
-
28
15
  Sidekiq.configure_server do |config|
29
- config.redis = { db: 13, port: 6380 }
30
- #config.redis = { db: 13 }
16
+ #config.options[:concurrency] = 1
17
+ config.redis = { db: 13 }
31
18
  config.options[:queues] << 'default'
32
19
  config.logger.level = Logger::ERROR
33
20
  config.average_scheduled_poll_interval = 2
@@ -49,17 +36,17 @@ end
49
36
  # brew tap shopify/shopify
50
37
  # brew install toxiproxy
51
38
  # gem install toxiproxy
52
- require 'toxiproxy'
39
+ #require 'toxiproxy'
53
40
  # simulate a non-localhost network for realer-world conditions.
54
41
  # adding 1ms of network latency has an ENORMOUS impact on benchmarks
55
- Toxiproxy.populate([{
56
- "name": "redis",
57
- "listen": "127.0.0.1:6380",
58
- "upstream": "127.0.0.1:6379"
59
- }])
42
+ #Toxiproxy.populate([{
43
+ #"name": "redis",
44
+ #"listen": "127.0.0.1:6380",
45
+ #"upstream": "127.0.0.1:6379"
46
+ #}])
60
47
 
61
48
  self_read, self_write = IO.pipe
62
- %w(INT TERM USR1 USR2 TTIN).each do |sig|
49
+ %w(INT TERM TSTP TTIN).each do |sig|
63
50
  begin
64
51
  trap sig do
65
52
  self_write.puts(sig)
@@ -80,14 +67,9 @@ def handle_signal(launcher, sig)
80
67
  when 'TERM'
81
68
  # Heroku sends TERM and then waits 10 seconds for process to exit.
82
69
  raise Interrupt
83
- when 'USR1'
84
- Sidekiq.logger.info "Received USR1, no longer accepting new work"
70
+ when 'TSTP'
71
+ Sidekiq.logger.info "Received TSTP, no longer accepting new work"
85
72
  launcher.quiet
86
- when 'USR2'
87
- if Sidekiq.options[:logfile]
88
- Sidekiq.logger.info "Received USR2, reopening log file"
89
- Sidekiq::Logging.reopen_logs
90
- end
91
73
  when 'TTIN'
92
74
  Thread.list.each do |thread|
93
75
  Sidekiq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
@@ -121,7 +103,7 @@ Sidekiq.logger.error "Created #{count*iter} jobs"
121
103
  Monitoring = Thread.new do
122
104
  watchdog("monitor thread") do
123
105
  while true
124
- sleep 2
106
+ sleep 1
125
107
  qsize, retries = Sidekiq.redis do |conn|
126
108
  conn.pipelined do
127
109
  conn.llen "queue:default"
@@ -143,8 +125,8 @@ begin
143
125
  #RubyProf::exclude_threads = [ Monitoring ]
144
126
  #RubyProf.start
145
127
  fire_event(:startup)
146
- Sidekiq.logger.error "Simulating 1ms of latency between Sidekiq and redis"
147
- Toxiproxy[:redis].downstream(:latency, latency: 1).apply do
128
+ #Sidekiq.logger.error "Simulating 1ms of latency between Sidekiq and redis"
129
+ #Toxiproxy[:redis].downstream(:latency, latency: 1).apply do
148
130
  launcher = Sidekiq::Launcher.new(Sidekiq.options)
149
131
  launcher.run
150
132
 
@@ -152,7 +134,7 @@ begin
152
134
  signal = readable_io.first[0].gets.strip
153
135
  handle_signal(launcher, signal)
154
136
  end
155
- end
137
+ #end
156
138
  rescue SystemExit => e
157
139
  #Sidekiq.logger.error("Profiling...")
158
140
  #result = RubyProf.stop
@@ -0,0 +1,50 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This Code of Conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting the project maintainer at mperham AT gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+
45
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
46
+ version 1.3.0, available at
47
+ [http://contributor-covenant.org/version/1/3/0/][version]
48
+
49
+ [homepage]: http://contributor-covenant.org
50
+ [version]: http://contributor-covenant.org/version/1/3/0/