resque 1.23.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/HISTORY.md +271 -0
  3. data/README.markdown +454 -484
  4. data/Rakefile +4 -17
  5. data/bin/resque-web +10 -22
  6. data/lib/resque/data_store.rb +335 -0
  7. data/lib/resque/errors.rb +15 -1
  8. data/lib/resque/failure/airbrake.rb +32 -4
  9. data/lib/resque/failure/base.rb +16 -7
  10. data/lib/resque/failure/multiple.rb +26 -8
  11. data/lib/resque/failure/redis.rb +92 -15
  12. data/lib/resque/failure/redis_multi_queue.rb +104 -0
  13. data/lib/resque/failure.rb +62 -32
  14. data/lib/resque/helpers.rb +11 -57
  15. data/lib/resque/job.rb +79 -12
  16. data/lib/resque/log_formatters/quiet_formatter.rb +7 -0
  17. data/lib/resque/log_formatters/verbose_formatter.rb +7 -0
  18. data/lib/resque/log_formatters/very_verbose_formatter.rb +8 -0
  19. data/lib/resque/logging.rb +18 -0
  20. data/lib/resque/plugin.rb +22 -10
  21. data/lib/resque/railtie.rb +10 -0
  22. data/lib/resque/server/public/jquery-3.6.0.min.js +2 -0
  23. data/lib/resque/server/public/jquery.relatize_date.js +4 -4
  24. data/lib/resque/server/public/main.js +3 -0
  25. data/lib/resque/server/public/ranger.js +16 -8
  26. data/lib/resque/server/public/style.css +13 -8
  27. data/lib/resque/server/views/error.erb +1 -1
  28. data/lib/resque/server/views/failed.erb +27 -59
  29. data/lib/resque/server/views/failed_job.erb +50 -0
  30. data/lib/resque/server/views/failed_queues_overview.erb +24 -0
  31. data/lib/resque/server/views/job_class.erb +8 -0
  32. data/lib/resque/server/views/key_sets.erb +2 -4
  33. data/lib/resque/server/views/key_string.erb +1 -1
  34. data/lib/resque/server/views/layout.erb +7 -6
  35. data/lib/resque/server/views/next_more.erb +22 -10
  36. data/lib/resque/server/views/processing.erb +2 -0
  37. data/lib/resque/server/views/queues.erb +22 -13
  38. data/lib/resque/server/views/stats.erb +5 -5
  39. data/lib/resque/server/views/workers.erb +4 -4
  40. data/lib/resque/server/views/working.erb +10 -11
  41. data/lib/resque/server.rb +51 -108
  42. data/lib/resque/server_helper.rb +185 -0
  43. data/lib/resque/stat.rb +19 -7
  44. data/lib/resque/tasks.rb +26 -25
  45. data/lib/resque/thread_signal.rb +24 -0
  46. data/lib/resque/vendor/utf8_util.rb +2 -8
  47. data/lib/resque/version.rb +1 -1
  48. data/lib/resque/web_runner.rb +374 -0
  49. data/lib/resque/worker.rb +487 -163
  50. data/lib/resque.rb +332 -52
  51. data/lib/tasks/redis.rake +11 -11
  52. metadata +169 -149
  53. data/lib/resque/failure/hoptoad.rb +0 -33
  54. data/lib/resque/failure/thoughtbot.rb +0 -33
  55. data/lib/resque/server/public/jquery-1.3.2.min.js +0 -19
  56. data/lib/resque/server/test_helper.rb +0 -19
  57. data/lib/resque/vendor/utf8_util/utf8_util_18.rb +0 -91
  58. data/lib/resque/vendor/utf8_util/utf8_util_19.rb +0 -5
  59. data/test/airbrake_test.rb +0 -27
  60. data/test/hoptoad_test.rb +0 -26
  61. data/test/job_hooks_test.rb +0 -464
  62. data/test/job_plugins_test.rb +0 -230
  63. data/test/plugin_test.rb +0 -116
  64. data/test/redis-test-cluster.conf +0 -115
  65. data/test/redis-test.conf +0 -115
  66. data/test/resque-web_test.rb +0 -59
  67. data/test/resque_failure_redis_test.rb +0 -19
  68. data/test/resque_test.rb +0 -278
  69. data/test/test_helper.rb +0 -178
  70. data/test/worker_test.rb +0 -657
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f8cf648f1eb756bfe114e702e712d3b9a6748288d25194bf982c29b94b7ea7b5
4
+ data.tar.gz: e878e1cbe5a8bcf2a915a35c0038b24056f52bd845782934536968da71d90719
5
+ SHA512:
6
+ metadata.gz: 28094061441be3776fd2541ea43e678ad8270b1c620aa1bf11a2368f8c913e0c0069b481ecc1d17d336f432f7032b61b20d2a80e646231a7f86dacbd68e789b8
7
+ data.tar.gz: 3f3b8f2edc6f8b006ab650e2431db26e4fac0230adddc9f9fb748601bf9d6f16581208d20283b4a44e5303ae8a54993e8a324821492996d61a05b2e6f72adb7d
data/HISTORY.md CHANGED
@@ -1,3 +1,274 @@
1
+ ## 2.6.0
2
+
3
+ ### Fixed
4
+
5
+ * resque-web: Fix reflected XSS in queues endpoint (#1865)
6
+ * resque-web: Format args in YAML (#1875)
7
+ * Fix MiniTest undefined errors (#1879)
8
+ * Fix failing reconnect tests (#1880)
9
+
10
+ ### Added
11
+
12
+ * Documents how to make the worker shutdown when the queue is empty (#1873)
13
+
14
+ ## 2.5.0
15
+
16
+ ### Fixed
17
+
18
+ * Replace `File.exists?` with `File.exist?` (#1846)
19
+ * Escape `Resque.redis_id` for stats page (#1834)
20
+ * Escape resque info values (#1832)
21
+ * Correctly show the values of hash and none type on stats tab (#1838)
22
+ * Fix logging the worker name when starting the task (#1837)
23
+
24
+ ### Added
25
+
26
+ * Raise an error when no available Rack server was found (#1836)
27
+ * Move code in `Resque::Server.helpers` block into a module to make it testable (#1851)
28
+
29
+ ## 2.4.0
30
+
31
+ ### Fixed
32
+
33
+ * Remove `thread_safe` arg in Redis instantiaons (#1822)
34
+ * Updated Test Matrix for Redis 5.0 (#1824)
35
+ * Fix redis-rb 4.8 deprecation warnings (#1827)
36
+ * Fix redis-rb 5.0 compatibility issues (#1828)
37
+
38
+ ## 2.3.0
39
+
40
+ ### Fixed
41
+
42
+ * Fix NoMethodError: undefined method 'application' for Rails:Module when Rails module is defined but not a full Rails app (#1799)
43
+ * Fix deprecation warnings in Redis#pipelined for redis 4.6 (#1806)
44
+ * Add Ruby syntax highlighting to remaining markdown docs (#1802)
45
+ * Fix pagination section (#1809)
46
+ * Fix `before_run` undefined local variable or method `runner` (#1811)
47
+
48
+ ### Added
49
+
50
+ * Added support for pausing all workers by setting the Redis key `pause-all-workers` to string value "true" (#1803)
51
+
52
+ ## 2.2.1
53
+
54
+ ### Fixed
55
+
56
+ * Escape HTML from the params to avoid XSS (#1790)
57
+ * Remove vegas as a dependency (#1780)
58
+
59
+ ### Added
60
+
61
+ * Add support for specifying queues that workers should ignore when using globs
62
+ * Allow plugins to have spaces in their name (#1718)
63
+
64
+ ## 2.2.0
65
+
66
+ ### Added
67
+
68
+ * Add 'Retry Failed Jobs' button to Failed page
69
+
70
+ ### Fixed
71
+
72
+ * Loading railtie when it did not exist #1765
73
+ * Fix closing parent Redis connection in child process after fork
74
+ * Fix the failed queues list on /queues UI when the RedisMultiQueue backend is used #1638
75
+
76
+ ## 2.1.0
77
+
78
+ ### Security
79
+
80
+ * Fix XSS via URL path in admin web UI queues view #1687
81
+ * Replace onclick handlers in server code to support Content Security Policies that don't allow 'unsafe-inline'
82
+ * Update jQuery from 1.12.4 to 3.6.0
83
+
84
+ ### Added
85
+
86
+ * Add requeue_queue method to Resque::Failure::Multiple #1659
87
+ * Confirmation prompt in admin front-end before submitting the retry of all failed jobs. #1753
88
+ * Railtie for default rake task setup when in Rails. #1715
89
+ * Added two new hooks.
90
+ - `queue_empty` when the job queue empties and the worker becomes idle
91
+ - `worker_exit` when the worker exits
92
+
93
+ See [docs/HOOKS.md](http://github.com/resque/resque/blob/master/docs/HOOKS.md) for
94
+ further details. (@jeremywadsack)
95
+
96
+ ### Fixed
97
+
98
+ * live poller shouldn't restart itself until it successds or fails. #1740
99
+ * Fix parsing worker_id when queue name includes colon. #1691
100
+ * Prune workers which haven't been registered but have set a heartbeat. #1751
101
+ * `Resque::Failure::Multiple.remove` did not pass on the queue parameter
102
+
103
+ ## 2.0.0 (2018-11-06)
104
+
105
+ ### Fixed
106
+ * Fix Airbrake failure backend
107
+ * Fix failed jobs page "argument out of range" error
108
+
109
+ ### Changed
110
+ * Remove support for Rubies < 2.3
111
+ * Remove support to Rails < 4
112
+ * Reduce the number of redis calls when trying to get the list of queues
113
+ * Only run `eager_load!` if `Rails.application.config.eager_load` is true
114
+ * Don't display log message if running without hooks
115
+ * Add Support to Redis 4.0
116
+ * Drop complex Redis identifier logic in favor of simple inspect
117
+ * When a child process is killed, report the signal it was terminated with
118
+ * Report a job that pruned worker was processing
119
+
120
+ ### Added
121
+
122
+ * Allow to configure statistic data store
123
+
124
+ ## 1.27.4 (2017-04-15)
125
+
126
+ ### Fixed
127
+ * Fix issue where removing a failure from Resque web didn't work when using `RedisMultiQueue` backend.
128
+
129
+ ## 1.27.3 (2017-04-10)
130
+
131
+ ### Fixed
132
+ * Fix issue where initializing a data store would attempt to hit Redis, even when Resque.inline = true
133
+
134
+ ## 1.27.2 (2017-02-20)
135
+
136
+ ### Fixed
137
+ * Require "redis/distributed" in worker.rb to allow proper rescuing
138
+ * Fallback to server time if Redis time won't work (restores Redis 2.4 support)
139
+
140
+ ## 1.27.1 (2017-02-13)
141
+
142
+ ### Fixed
143
+ * Show actual jobs names in web view using ActiveJob (@martnst)
144
+
145
+ ## 1.27.0 (2017-02-08)
146
+
147
+ ### Fixed
148
+ * Fix issue where calling Worker.find, Worker.all, or Worker.working from withing
149
+ a running job would rewrite the PID file with the PID of the forked worker.
150
+ This causes a change to the Worker#new API that may affect plugin
151
+ implementations. See Worker#new and Worker#prepare for details. (@jeremywadsack)
152
+ * Workers queried out now have the correct hostname (@crazymykl)
153
+ * Fix race condition on worker startup (@stevedomin)
154
+ * No longer triggers verbose logging if env variables are not set (@ldnunes)
155
+ * resque/failed/requeue/all when using Redis::Failure::Multiple no longer raises an exception (@ale7714)
156
+ * Improve forking to avoid having a child process escape its code (@dylanahsmith)
157
+ * Workers now use server time rather than their own time to maintain heartbeats (@fw42)
158
+ * Run eager load hooks for Rails applications versioned 4.x and up (@abhi-patel)
159
+ * Fix bug when encountering an error while pruning workers (Joakim Kolsjö and Tomas Skogberg)
160
+ * Children write to PIDFILE immediately after forking, fixing issues when reconnecting to Redis is slow (@fimmtiu)
161
+
162
+ ### Changed
163
+ * Update jQuery from 1.3.2 to 1.12.4 (@chrisccerami)
164
+ * No longer user Thread.kill to stop heartbeat (@Sinjo)
165
+
166
+ ### Added
167
+ * Resque Web UI now prompts for confirmation on clearing failed jobs (Markus Olsen)
168
+ * Adds process status to DirtyExit exception when job is killed via signal (@MishaConway)
169
+
170
+ ## 1.26.0 (2016-03-10)
171
+
172
+ This changelog is a bit incomplete. We will be much stricter about the changelog for
173
+ the next release.
174
+
175
+ * rake: when BACKGROUND, ensure worker.reconnect after daemonizing (@yaauie)
176
+ * worker: when searching workers, Worker#pid properly reflects pid of the found
177
+ worker instead of the current pid. (@yaauie)
178
+ * Add support for RESQUE_PROCLINE_PREFIX environment variable to prefix
179
+ procline strings with a static identifier. (@rbroemeling)
180
+ * Resque::Worker logs errors at the correct logging level (@chrisccerami)
181
+
182
+ ## 1.25.2 (2014-3-3)
183
+
184
+ * Respect TERM_CHILD setting when not forking (@ggilder)
185
+ * implementation of backend connection with a hash (Andrea Rossi)
186
+ * require yaml for show_args support (@yaauie)
187
+ * use redis-namespace 1.3 (Andrea Rossi)
188
+ * fix DOCS link in README (@cade)
189
+ * Fix worker prune test to actually run its assertion & cover reality. (@yaauie)
190
+ * Eliminate infinite recursion when Resque::Helpers mixed into Resque (@yaml)
191
+ * use ruby, avoid shelling out. google++ (@hone)
192
+ * Failed Assertions Don't Fail Tests :rage: (@yaauie)
193
+
194
+ ## 1.25.1 (2013-9-26)
195
+
196
+ * Actually require Forwardable from the standard library.
197
+
198
+ ## 1.25.0 (2013-4-16)
199
+ * Updates fork method so [resque-multi-job-forks](https://github.com/stulentsev/resque-multi-job-forks)
200
+ monkey patching works again. See discussion at https://github.com/defunkt/resque/pull/895 for more
201
+ context (@jonhyman)
202
+ * Use Redis.pipelined to group batches of redis commands.
203
+ https://github.com/resque/resque/pull/902 (@jonhyman)
204
+ * Fixed uninitialize constant for the module/class that contains the perform
205
+ method causing job failures to no be reported, #792 (@sideshowcoder)
206
+ * Fix Resque::Failure::Base.all to have the correct signature.
207
+ (@rentalutions)
208
+ * Don't close stdio pipes when daemonizing so as to not hide errors. #967
209
+ (@sideshowcoder)
210
+ * Fix for worker_pids on Windows. #980 (@kzgs)
211
+ * Only prune workers for queues the current worker knows about. #1000
212
+ (!) (@dsabanin)
213
+ * Handle duplicate TERM signals. #988 (@softwaregravy)
214
+ * Fix issue with exiting workers and unintentionally deregistering the
215
+ parent when the forked child exits. #1017 (@magec)
216
+ * Fix encoding errors with local date formatting. #1065 (@katafrakt)
217
+ * Fix CI for 1.8.7 and 1.9.2 modes due to dependencies. #1090
218
+ (@adelcambre)
219
+ * Allow using globs for queue names to listen on, allowing things like
220
+ listening on `staging_*`. #1085 (@adelcambre)
221
+
222
+
223
+ ## 1.24.1 (2013-3-23)
224
+
225
+ * Adds a default value for `per_page` on resque-server for plugins which add tabs (@jonhyman)
226
+ * Fix bad logic on the failed queue adapter
227
+ * Added missing `require 'time'` which was causing occasional errors which
228
+ would crash workers.
229
+
230
+ ## 1.24.0 (2013-3-21)
231
+
232
+ * Web UI: Fix regression that caused the failure tab to break when using
233
+ certain failure backends (@kjg)
234
+ * Web UI: Add page list to queues (@ql)
235
+ * Web UI: Fix regression that caused the failure tab to break when clicking on
236
+ "clear all failures" under certain failure backends, #859 (@jonhyman)
237
+ * Fix regression for Resque hooks where Resque would error out if you assigned
238
+ multiple hooks using an array, #859 (@jonhyman)
239
+ * Adds ENV["RUN_AT_EXIT_HOOKS"] which when set to 1 causes any defined
240
+ `at_exit` hooks to be run on the child when the forked process exits, #862
241
+ (@jonhyman)
242
+ * Bump up redis-namespace to 1.2.
243
+ * Remove multi_json, the JSON gem does the right thing everywhere now.
244
+ * Documentation fixes with demo instructions.
245
+ * Fixed encoding for worker PIDs on Windows (@kzgs)
246
+ * Cache value of PID in an ivar. This way, if you try to look up worker PIDs
247
+ from some other process (such as the console), they will be correct.
248
+ * Add a mutex-free logger. Ruby 2.0 does not allow you to use a mutex from
249
+ a signal handler, which can potentially cause deadlock. Now we're using
250
+ `mono_logger`, which has no locks.
251
+
252
+ ## 1.23.1 (2013-3-7)
253
+
254
+ * JRuby and Rubinius are 'allow failure' on CI. This is largely due to Travis
255
+ weridness and flaky tests.
256
+ * Fix link from "queues" view to "failed" view when there's only one failed
257
+ queue (trliner)
258
+ * Making all the failure backends have the same method signature for duck
259
+ typing purposes (jonhyman)
260
+ * Fix log formatters not appending a new line (flavorpill)
261
+ * redirect unauthorized resque-web polling requests to root url (trliner)
262
+ * Various resque-web fixes (@tarcieri)
263
+ * Optional RedisMultiQueue failure backend, can be enabled with
264
+ FAILURE_BACKEND=redis_multi_queue env var (@tarcieri)
265
+ * resque:failures:sort rake task will migrate an existing "failed" queue into
266
+ separate failure queues per job queue, allowing an easy migration to
267
+ the RedisMultiQueue failure backend (@tarcieri)
268
+ * Disable forking completely with FORK_PER_JOB=false env var (@tarcieri)
269
+ * Report a failure when processes are killed with signals (@dylanahsmith)
270
+ * Enable registering of multiple Resque hooks (@panthomakos, @jonhyman)
271
+
1
272
  ## 1.23.0 (2012-10-01)
2
273
 
3
274
  * don't run `before_fork` hook if Resque can't fork (@kjwierenga, @tarcieri, #672, #697)