que 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 935bd86044462d53952ebcaa287b1922956a031d02849326a73ed5358fb367c8
4
- data.tar.gz: 999cda08420fedef6900e515701f939cbc25c63a9c2a9bf3e8f1946ee1ac7e3d
3
+ metadata.gz: 373d26eb482dac300ae6c808412b53444b2103ac5bb5dd323458aa0fe41f70fb
4
+ data.tar.gz: 26d52759e16382fd52d36582f371f8f059366e019c1cd34851bc69dad1072dab
5
5
  SHA512:
6
- metadata.gz: 2d9e489f372ab29e6d97673fe95eb4429ac28f5270c644f888314485bc39c641997ff024cd9696532560fdad11b80d0bb1833be6d1b4d0a3cfef57fa7c6719f6
7
- data.tar.gz: 816c449a67aa15a7eba3177a34a2ffbbc0a85b59d0a2ce48fd44d78343e0bee2bd2b25b05001d5c4168442eb362f4fa97f2fe61b533f07b1f271a4003f53b1c5
6
+ metadata.gz: 6a4a4aeb666cb9f663b11098fdbf7f2f45c1a67438f61474e57f28a4af981f6bfdeaeb1f54b3530e3975629df72cc2c2875ca39b970a25429d01d84a0c1e2941
7
+ data.tar.gz: e690054f2d5a8294e1e801897f2bab6f2e1afe6afee0b355d026f03550434d2709f6a6f2311f4664619d5fdbc42cb90b18ade0b2ed510bb5bd8571cd22213e57
data/CHANGELOG.md CHANGED
@@ -1,11 +1,75 @@
1
- ### 1.3.1 (2022-02-25)
1
+ # Changelog
2
+
3
+ <!-- MarkdownTOC autolink=true -->
4
+
5
+ - [1.4.0 \(2022-03-23\)](#140-2022-03-23)
6
+ - [1.3.1 \(2022-02-25\)](#131-2022-02-25)
7
+ - [1.3.0 \(2022-02-25\)](#130-2022-02-25)
8
+ - [1.2.0 \(2022-02-23\)](#120-2022-02-23)
9
+ - [1.1.0 \(2022-02-21\)](#110-2022-02-21)
10
+ - [1.0.0 \(2022-01-24\)](#100-2022-01-24)
11
+ - [1.0.0.beta5 \(2021-12-23\)](#100beta5-2021-12-23)
12
+ - [1.0.0.beta4 \(2020-01-17\)](#100beta4-2020-01-17)
13
+ - [1.0.0.beta3 \(2018-05-18\)](#100beta3-2018-05-18)
14
+ - [1.0.0.beta2 \(2018-04-13\)](#100beta2-2018-04-13)
15
+ - [1.0.0.beta \(2017-10-25\)](#100beta-2017-10-25)
16
+ - [0.14.3 \(2018-03-02\)](#0143-2018-03-02)
17
+ - [0.14.2 \(2018-01-05\)](#0142-2018-01-05)
18
+ - [0.14.1 \(2017-12-14\)](#0141-2017-12-14)
19
+ - [0.14.0 \(2017-08-11\)](#0140-2017-08-11)
20
+ - [0.13.1 \(2017-07-05\)](#0131-2017-07-05)
21
+ - [0.13.0 \(2017-06-08\)](#0130-2017-06-08)
22
+ - [0.12.3 \(2017-06-01\)](#0123-2017-06-01)
23
+ - [0.12.2 \(2017-06-01\)](#0122-2017-06-01)
24
+ - [0.12.1 \(2017-01-22\)](#0121-2017-01-22)
25
+ - [0.12.0 \(2016-09-09\)](#0120-2016-09-09)
26
+ - [0.11.6 \(2016-07-01\)](#0116-2016-07-01)
27
+ - [0.11.5 \(2016-05-13\)](#0115-2016-05-13)
28
+ - [0.11.4 \(2016-03-03\)](#0114-2016-03-03)
29
+ - [0.11.3 \(2016-02-26\)](#0113-2016-02-26)
30
+ - [0.11.2 \(2015-09-09\)](#0112-2015-09-09)
31
+ - [0.11.1 \(2015-09-04\)](#0111-2015-09-04)
32
+ - [0.11.0 \(2015-09-04\)](#0110-2015-09-04)
33
+ - [0.10.0 \(2015-03-18\)](#0100-2015-03-18)
34
+ - [0.9.2 \(2015-02-05\)](#092-2015-02-05)
35
+ - [0.9.1 \(2015-01-11\)](#091-2015-01-11)
36
+ - [0.9.0 \(2014-12-16\)](#090-2014-12-16)
37
+ - [0.8.2 \(2014-10-12\)](#082-2014-10-12)
38
+ - [0.8.1 \(2014-07-28\)](#081-2014-07-28)
39
+ - [0.8.0 \(2014-07-12\)](#080-2014-07-12)
40
+ - [0.7.3 \(2014-05-19\)](#073-2014-05-19)
41
+ - [0.7.2 \(2014-05-18\)](#072-2014-05-18)
42
+ - [0.7.1 \(2014-04-29\)](#071-2014-04-29)
43
+ - [0.7.0 \(2014-04-09\)](#070-2014-04-09)
44
+ - [0.6.0 \(2014-02-04\)](#060-2014-02-04)
45
+ - [0.5.0 \(2014-01-14\)](#050-2014-01-14)
46
+ - [0.4.0 \(2014-01-05\)](#040-2014-01-05)
47
+ - [0.3.0 \(2013-12-21\)](#030-2013-12-21)
48
+ - [0.2.0 \(2013-11-30\)](#020-2013-11-30)
49
+ - [0.1.0 \(2013-11-18\)](#010-2013-11-18)
50
+ - [0.0.1 \(2013-11-07\)](#001-2013-11-07)
51
+
52
+ <!-- /MarkdownTOC -->
53
+
54
+ ## 1.4.0 (2022-03-23)
55
+
56
+ - **Fixed**
57
+ + The poller will no longer sleep when jobs exist for only some of its priorities. It now skips sleeping when a poll returns more jobs than the lowest priority requested. [#349](https://github.com/que-rb/que/pull/349).
58
+ * An alternative was considered which skipped polling when only some of the waiting worker priorities would be fully utilised ([diagram explanation](https://github.com/que-rb/que/pull/348#discussion_r819213357)); but this was decided against for code complexity reasons. [#348](https://github.com/que-rb/que/pull/348)
59
+ - **Deprecated**:
60
+ + Deprecated `--minimum-buffer-size` option. It was not actually used, and will be removed in v2.0.0. [#346](https://github.com/que-rb/que/pull/346)
61
+ * It became used in 1.0.0.beta4, and that changelog entry has been updated to reflect this.
62
+ - **Documentation**:
63
+ + Reformatted the changelog to be more consistent, including adding links to all issue/PR numbers. [#347](https://github.com/que-rb/que/pull/347)
64
+
65
+ ## 1.3.1 (2022-02-25)
2
66
 
3
67
  Unfortunately, v1.3.0 was broken. Follow its upgrade instructions, but use this version instead.
4
68
 
5
69
  - **Fixed**
6
70
  + Fixed startup error: `undefined method 'job_schema_version' for Que:Module`, in [#343](https://github.com/que-rb/que/pull/343)
7
71
 
8
- ### 1.3.0 (2022-02-25)
72
+ ## 1.3.0 (2022-02-25)
9
73
 
10
74
  **ACTION REQUIRED**
11
75
 
@@ -46,623 +110,378 @@ If you use any Que plugins or custom code that interacts with the `que_jobs` tab
46
110
  + Added Git pre-push hook, in [#338](https://github.com/que-rb/que/pull/338)
47
111
  + Documented our gem release process, in [#341](https://github.com/que-rb/que/pull/341)
48
112
 
49
- ### 1.2.0 (2022-02-23)
113
+ ## 1.2.0 (2022-02-23)
50
114
 
51
115
  - **Deprecated**
52
116
  + Providing job options as top level keyword arguments to Job.enqueue is now deprecated. Support will be dropped in `2.0`. Job options should be nested under the `job_options` keyword arg instead. See [#336](https://github.com/que-rb/que/pull/336)
53
117
 
54
- ### 1.1.0 (2022-02-21)
118
+ ## 1.1.0 (2022-02-21)
55
119
 
56
120
  - **Features**:
57
121
  + Add backtrace to errors, by [@trammel](https://github.com/trammel) in [#328](https://github.com/que-rb/que/pull/328)
58
122
  - **Internal**:
59
123
  + Add Dockerised development environment, in [#324](https://github.com/que-rb/que/pull/324)
60
124
 
61
- ### 1.0.0 (2022-01-24)
125
+ ## 1.0.0 (2022-01-24)
62
126
 
63
127
  _This release does not add any changes on top of 1.0.0.beta5._
64
128
 
65
- ### 1.0.0.beta5 (2021-12-23)
66
-
67
- * **Bug fixes and improvements**
68
- * Add more context to error message when config files fail to load. by [@trammel](https://github.com/trammel) in [#293](https://github.com/que-rb/que/pull/293)
69
- * Fix lock leak on PostgreSQL 12 and later by [@jasoncodes](https://github.com/jasoncodes) in [#298](https://github.com/que-rb/que/pull/298)
70
- * Fix deadlock issue [#318](https://github.com/que-rb/que/pull/318)
71
- * Fix thread attrition issue [#321](https://github.com/que-rb/que/pull/321)
72
-
73
- * **Rails fixes:**
74
- * Set schema in table_name for ActiveRecord model by [@nikitug](https://github.com/nikitug) in [#274](https://github.com/que-rb/que/pull/274)
75
-
76
- * **Documentation:**
77
- * Add link to que-locks for exclusive job locking by [@airhorns](https://github.com/airhorns) in [#263](https://github.com/que-rb/que/pull/263)
129
+ ## 1.0.0.beta5 (2021-12-23)
130
+
131
+ - **Bug fixes and improvements**
132
+ + Add more context to error message when config files fail to load. by [@trammel](https://github.com/trammel) in [#293](https://github.com/que-rb/que/pull/293)
133
+ + Fix lock leak on PostgreSQL 12 and later by [@jasoncodes](https://github.com/jasoncodes) in [#298](https://github.com/que-rb/que/pull/298)
134
+ + Fix deadlock issue [#318](https://github.com/que-rb/que/pull/318)
135
+ + Fix thread attrition issue [#321](https://github.com/que-rb/que/pull/321)
136
+ - **Rails fixes:**
137
+ + Set schema in table_name for ActiveRecord model by [@nikitug](https://github.com/nikitug) in [#274](https://github.com/que-rb/que/pull/274)
138
+ - **Documentation:**
139
+ + Add link to que-locks for exclusive job locking by [@airhorns](https://github.com/airhorns) in [#263](https://github.com/que-rb/que/pull/263)
78
140
  [`5259303`](https://github.com/que-rb/que/commit/52593031a7eef2d52ac38eceb2d8df776ec74090)
79
- * Fix links to Writing Reliable Jobs by [@nikitug](https://github.com/nikitug) in [#273](https://github.com/que-rb/que/pull/273)
80
- * Add build badge to README by [@jonathanhefner](https://github.com/jonathanhefner) in [#278](https://github.com/que-rb/que/pull/278)
81
- * Fix ToC links in docs by [@swrobel](https://github.com/swrobel) in [#287](https://github.com/que-rb/que/pull/287)
82
- * Note all Rails queue names that must be changed by [@swrobel](https://github.com/swrobel) in [#296](https://github.com/que-rb/que/pull/296)
83
- * Add instructions for how to start Que by [@xcskier56](https://github.com/xcskier56) in [#292](https://github.com/que-rb/que/pull/292)
84
-
85
- * **CI/tests**
86
- * Fix CI failure from Docker Postgres image by [@jonathanhefner](https://github.com/jonathanhefner) in [#275](https://github.com/que-rb/que/pull/275)
87
- * Test with Ruby 2.7 by [@jonathanhefner](https://github.com/jonathanhefner) in [#276](https://github.com/que-rb/que/pull/276)
88
- * Run GitHub build workflow on push by [@jonathanhefner](https://github.com/jonathanhefner) in [#277](https://github.com/que-rb/que/pull/277)
89
-
90
-
141
+ + Fix links to Writing Reliable Jobs by [@nikitug](https://github.com/nikitug) in [#273](https://github.com/que-rb/que/pull/273)
142
+ + Add build badge to README by [@jonathanhefner](https://github.com/jonathanhefner) in [#278](https://github.com/que-rb/que/pull/278)
143
+ + Fix ToC links in docs by [@swrobel](https://github.com/swrobel) in [#287](https://github.com/que-rb/que/pull/287)
144
+ + Note all Rails queue names that must be changed by [@swrobel](https://github.com/swrobel) in [#296](https://github.com/que-rb/que/pull/296)
145
+ + Add instructions for how to start Que by [@xcskier56](https://github.com/xcskier56) in [#292](https://github.com/que-rb/que/pull/292)
146
+ - **CI/tests**
147
+ + Fix CI failure from Docker Postgres image by [@jonathanhefner](https://github.com/jonathanhefner) in [#275](https://github.com/que-rb/que/pull/275)
148
+ + Test with Ruby 2.7 by [@jonathanhefner](https://github.com/jonathanhefner) in [#276](https://github.com/que-rb/que/pull/276)
149
+ + Run GitHub build workflow on push by [@jonathanhefner](https://github.com/jonathanhefner) in [#277](https://github.com/que-rb/que/pull/277)
91
150
  **Full Changelog**: [`v1.0.0.beta4...v1.0.0.beta5`](https://github.com/que-rb/que/compare/v1.0.0.beta4...v1.0.0.beta5)
92
-
93
151
  **Unless an issue is found we intend for this release to become v1.0.0 proper.**
94
152
 
95
- ---
96
-
97
- ### 1.0.0.beta4 (2020-01-17)
98
-
99
- - Rails 6 compatibility: Fix time parsing #249 and https://github.com/que-rb/que/commit/5ddddd5ebac6153d7a683ef08c86bced8e03fb51
100
- - Cleaner sequel usage #257
101
- - Documentation improvements #264 #269 #261 #231
102
-
103
- ---
104
-
105
- ### 1.0.0.beta3 (2018-05-18)
106
-
107
- * Added support for customizing log levels for `job_worked` events (#217).
108
-
109
- * Began logging all `job_errored` events at the `ERROR` log level.
110
-
111
- * Fixed the Railtie when running in test mode (#214).
112
-
113
- * Tweaked the meanings of worker-priorities and worker-count options in the CLI, to better support use cases with low worker counts (#216).
114
-
115
- ---
116
-
117
- ### 1.0.0.beta2 (2018-04-13)
118
-
119
- * **A schema upgrade to version 4 will be required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
120
-
121
- * Please note that this migration requires a rewrite of the jobs table, which makes it O(n) with the size of the table. If you have a very large backlog of jobs you may want to schedule downtime for this migration.
122
-
123
- * Que's implementation has been changed from one in which worker threads hold their own PG connections and lock their own jobs to one in which a single thread (and PG connection) locks jobs through LISTEN/NOTIFY and batch polling, and passes jobs along to worker threads. This has many benefits, including:
124
-
125
- * Jobs queued for immediate processing can be actively distributed to workers with LISTEN/NOTIFY, which is more efficient than having workers repeatedly poll for new jobs.
126
-
127
- * When polling is necessary (to pick up jobs that are scheduled for the future or that need to be retried due to errors), jobs can be locked and fetched in batches, rather than one at a time.
128
-
129
- * Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
130
-
131
- * PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
132
-
133
- * Other features introduced in this version include:
134
-
135
- * Much better support for all versions of ActiveJob.
136
-
137
- * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
138
-
139
- * Custom middleware that wrap running jobs and executing SQL statements are now supported.
140
-
141
- * Support for categorizing jobs with tags.
142
-
143
- * Support for configuring a `maximum_retry_count` on individual job classes.
144
-
145
- * Job configuration options are now inheritable, so job class hierarchies are more useful.
146
-
147
- * There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
148
-
149
- * Jobs that have finished working may optionally be retained in the database indefinitely.
150
-
151
- * To keep a job record, replace the `destroy` calls in your jobs with `finish`. `destroy` will still delete records entirely, for jobs that you don't want to keep.
152
-
153
- * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
154
-
155
- * Finished jobs have a timestamp set in the finished_at column.
156
-
157
- * Jobs that have errored too many times will now be marked as expired, and won't be retried again.
158
-
159
- * You can configure a maximum_retry_count in your job classes, to set the threshold at which a job will be marked expired. The default is 15.
160
-
161
- * To manually mark a job as expired (and keep it in the database but not try to run it again) you can call `expire` helper in your job.
162
-
163
- * You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
164
-
165
- * `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
166
-
167
- * `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
168
-
169
- * In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
170
-
171
- * Support for MRI Rubies before 2.2 has been dropped.
172
-
173
- * Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
174
-
175
- * JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
176
-
177
- * The `que:work` rake task has been removed. Use the `que` executable instead.
178
-
179
- * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
180
-
181
- * The `mode` setter has been removed.
182
-
183
- * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
184
-
185
- * To start up the worker pool (the old :async behavior) you should use the `que` executable to start up a worker process. There's no longer a supported API for running workers outside of the `que` executable.
186
-
187
- * The following methods are not meaningful under the new implementation and have been removed:
188
-
189
- * The `Que.wake_interval` getter and setter.
190
-
191
- * The `Que.worker_count` getter and setter.
192
-
193
- * `Que.wake!`
194
-
195
- * `Que.wake_all!`
196
-
197
- * Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
198
-
199
- * It's not clear that anyone ever actually did this.
200
-
201
- * `Que.worker_states` has been removed, as the connection that locks a job is no longer the one that the job is using to run. Its functionality has been partially replaced with `Que.job_states`.
202
-
203
- * When using Rails, for simplicity, job attributes and keys in argument hashes are now converted to symbols when retrieved from the database, rather than being converted to instances of HashWithIndifferentAccess.
204
-
205
- * Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
206
-
207
- * Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
208
-
209
- * It wouldn't have been a good idea to rely on this anyway.
210
-
211
- * Calling Que.log() directly is no longer supported/recommended.
212
-
213
- * Features marked as deprecated in the final 0.x releases have been removed.
214
-
215
- * Finally, if you've built up your own tooling and customizations around Que, you may need to be aware of some DB schema changes made in the migration to schema version #4.
216
-
217
- * The `job_id` column has been renamed `id` and is now the primary key. This makes it easier to manage the queue using an ActiveRecord model.
218
-
219
- * Finished jobs are now kept in the DB, unless you explicitly call `destroy`. If you want to query the DB for only jobs that haven't finished yet, add a `WHERE finished_at IS NULL` condition to your query, or use the not_finished scope on one of the provided ORM models.
220
-
221
- * There is now an `expired_at` timestamp column, which is set when a job reaches its maximum number of retries and will not be attempted again.
222
-
223
- * Due to popular demand, the default queue name is now "default" rather than an empty string. The migration will move pending jobs under the "" queue to the "default" queue.
224
-
225
- * The `last_error` column has been split in two, to `last_error_message` and `last_error_backtrace`. These two columns are now limited to 500 and 10,000 characters, respectively. The migration will split old error data correctly, and truncate it if necessary.
226
-
227
- * Names for queues and job classes are now limited to 500 characters, which is still far longer than either of these values should reasonably be.
228
-
229
- * There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
230
- ---
231
-
232
- ### 1.0.0.beta (2017-10-25)
233
-
234
- * **A schema upgrade to version 4 will be required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
235
-
236
- * Please note that this migration requires a rewrite of the jobs table, which makes it O(n) with the size of the table. If you have a very large backlog of jobs you may want to schedule downtime for this migration.
237
-
238
- * Que's implementation has been changed from one in which worker threads hold their own PG connections and lock their own jobs to one in which a single thread (and PG connection) locks jobs through LISTEN/NOTIFY and batch polling, and passes jobs along to worker threads. This has many benefits, including:
239
-
240
- * Jobs queued for immediate processing can be actively distributed to workers with LISTEN/NOTIFY, which is more efficient than having workers repeatedly poll for new jobs.
241
-
242
- * When polling is necessary (to pick up jobs that are scheduled for the future or that need to be retried due to errors), jobs can be locked and fetched in batches, rather than one at a time.
243
-
244
- * Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
245
-
246
- * PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
247
-
248
- * Other features introduced in this version include:
249
-
250
- * Much better support for all versions of ActiveJob.
251
-
252
- * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
253
-
254
- * Custom middleware that wrap running jobs are now supported.
255
-
256
- * Support for categorizing jobs with tags.
257
-
258
- * Support for configuring a `maximum_retry_count` on individual job classes.
259
-
260
- * Job configuration options are now inheritable, so job class hierarchies are more useful.
261
-
262
- * There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
263
-
264
- * Jobs that have finished working may optionally be retained in the database indefinitely.
265
-
266
- * To keep a job record, replace the `destroy` calls in your jobs with `finish`. `destroy` will still delete records entirely, for jobs that you don't want to keep.
267
-
268
- * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
269
-
270
- * Finished jobs have a timestamp set in the finished_at column.
271
-
272
- * Jobs that have errored too many times will now be marked as expired, and won't be retried again.
273
-
274
- * You can configure a maximum_retry_count in your job classes, to set the threshold at which a job will be marked expired. The default is 15.
275
-
276
- * To manually mark a job as expired (and keep it in the database but not try to run it again) you can call `expire` helper in your job.
277
-
278
- * You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
279
-
280
- * `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
281
-
282
- * `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
283
-
284
- * In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
285
-
286
- * Support for MRI Rubies before 2.2 has been dropped.
287
-
288
- * Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
289
-
290
- * JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
291
-
292
- * The `que:work` rake task has been removed. Use the `que` executable instead.
293
-
294
- * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
295
-
296
- * The `mode` setter has been removed.
297
-
298
- * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
299
-
300
- * To start up the worker pool (the old :async behavior) you should use the `que` executable to start up a worker process. There's no longer a supported API for running workers outside of the `que` executable.
301
-
302
- * The following methods are not meaningful under the new implementation and have been removed:
153
+ ## 1.0.0.beta4 (2020-01-17)
154
+
155
+ - Rails 6 compatibility: Fix time parsing [#249](https://github.com/que-rb/que/pull/249) and [5ddddd5](https://github.com/que-rb/que/commit/5ddddd5ebac6153d7a683ef08c86bced8e03fb51)
156
+ - Cleaner sequel usage, in [#257](https://github.com/que-rb/que/pull/257)
157
+ - Documentation improvements: [#264](https://github.com/que-rb/que/pull/264), [#269](https://github.com/que-rb/que/pull/269), [#261](https://github.com/que-rb/que/pull/261), [#231](https://github.com/que-rb/que/pull/231)
158
+ - The `--minimum-buffer-size` option is now unused
159
+
160
+ ## 1.0.0.beta3 (2018-05-18)
161
+
162
+ - Added support for customizing log levels for `job_worked` events ([#217](https://github.com/que-rb/que/issues/217)).
163
+ - Began logging all `job_errored` events at the `ERROR` log level.
164
+ - Fixed the Railtie when running in test mode ([#214](https://github.com/que-rb/que/issues/214)).
165
+ - Tweaked the meanings of worker-priorities and worker-count options in the CLI, to better support use cases with low worker counts ([#216](https://github.com/que-rb/que/issues/216)).
166
+
167
+ ## 1.0.0.beta2 (2018-04-13)
168
+
169
+ - **A schema upgrade to version 4 will be required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
170
+ + Please note that this migration requires a rewrite of the jobs table, which makes it O(n) with the size of the table. If you have a very large backlog of jobs you may want to schedule downtime for this migration.
171
+ - Que's implementation has been changed from one in which worker threads hold their own PG connections and lock their own jobs to one in which a single thread (and PG connection) locks jobs through LISTEN/NOTIFY and batch polling, and passes jobs along to worker threads. This has many benefits, including:
172
+ + Jobs queued for immediate processing can be actively distributed to workers with LISTEN/NOTIFY, which is more efficient than having workers repeatedly poll for new jobs.
173
+ + When polling is necessary (to pick up jobs that are scheduled for the future or that need to be retried due to errors), jobs can be locked and fetched in batches, rather than one at a time.
174
+ + Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
175
+ + PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
176
+ - Other features introduced in this version include:
177
+ + Much better support for all versions of ActiveJob.
178
+ * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
179
+ + Custom middleware that wrap running jobs and executing SQL statements are now supported.
180
+ + Support for categorizing jobs with tags.
181
+ + Support for configuring a `maximum_retry_count` on individual job classes.
182
+ + Job configuration options are now inheritable, so job class hierarchies are more useful.
183
+ + There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
184
+ + Jobs that have finished working may optionally be retained in the database indefinitely.
185
+ * To keep a job record, replace the `destroy` calls in your jobs with `finish`. `destroy` will still delete records entirely, for jobs that you don't want to keep.
186
+ * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
187
+ * Finished jobs have a timestamp set in the finished_at column.
188
+ + Jobs that have errored too many times will now be marked as expired, and won't be retried again.
189
+ * You can configure a maximum_retry_count in your job classes, to set the threshold at which a job will be marked expired. The default is 15.
190
+ * To manually mark a job as expired (and keep it in the database but not try to run it again) you can call `expire` helper in your job.
191
+ + You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
192
+ + `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
193
+ + `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
194
+ - In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
195
+ + Support for MRI Rubies before 2.2 has been dropped.
196
+ + Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
197
+ + JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
198
+ + The `que:work` rake task has been removed. Use the `que` executable instead.
199
+ * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
200
+ + The `mode` setter has been removed.
201
+ * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
202
+ * To start up the worker pool (the old :async behavior) you should use the `que` executable to start up a worker process. There's no longer a supported API for running workers outside of the `que` executable.
203
+ + The following methods are not meaningful under the new implementation and have been removed:
204
+ * The `Que.wake_interval` getter and setter.
205
+ * The `Que.worker_count` getter and setter.
206
+ * `Que.wake!`
207
+ * `Que.wake_all!`
208
+ + Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
209
+ * It's not clear that anyone ever actually did this.
210
+ + `Que.worker_states` has been removed, as the connection that locks a job is no longer the one that the job is using to run. Its functionality has been partially replaced with `Que.job_states`.
211
+ + When using Rails, for simplicity, job attributes and keys in argument hashes are now converted to symbols when retrieved from the database, rather than being converted to instances of HashWithIndifferentAccess.
212
+ + Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
213
+ + Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
214
+ * It wouldn't have been a good idea to rely on this anyway.
215
+ + Calling Que.log() directly is no longer supported/recommended.
216
+ + Features marked as deprecated in the final 0.x releases have been removed.
217
+ - Finally, if you've built up your own tooling and customizations around Que, you may need to be aware of some DB schema changes made in the migration to schema version #4.
218
+ + The `job_id` column has been renamed `id` and is now the primary key. This makes it easier to manage the queue using an ActiveRecord model.
219
+ + Finished jobs are now kept in the DB, unless you explicitly call `destroy`. If you want to query the DB for only jobs that haven't finished yet, add a `WHERE finished_at IS NULL` condition to your query, or use the not_finished scope on one of the provided ORM models.
220
+ + There is now an `expired_at` timestamp column, which is set when a job reaches its maximum number of retries and will not be attempted again.
221
+ + Due to popular demand, the default queue name is now "default" rather than an empty string. The migration will move pending jobs under the "" queue to the "default" queue.
222
+ + The `last_error` column has been split in two, to `last_error_message` and `last_error_backtrace`. These two columns are now limited to 500 and 10,000 characters, respectively. The migration will split old error data correctly, and truncate it if necessary.
223
+ + Names for queues and job classes are now limited to 500 characters, which is still far longer than either of these values should reasonably be.
224
+ + There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
225
+
226
+ ## 1.0.0.beta (2017-10-25)
227
+
228
+ - **A schema upgrade to version 4 will be required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
229
+ + Please note that this migration requires a rewrite of the jobs table, which makes it O(n) with the size of the table. If you have a very large backlog of jobs you may want to schedule downtime for this migration.
230
+ - Que's implementation has been changed from one in which worker threads hold their own PG connections and lock their own jobs to one in which a single thread (and PG connection) locks jobs through LISTEN/NOTIFY and batch polling, and passes jobs along to worker threads. This has many benefits, including:
231
+ + Jobs queued for immediate processing can be actively distributed to workers with LISTEN/NOTIFY, which is more efficient than having workers repeatedly poll for new jobs.
232
+ + When polling is necessary (to pick up jobs that are scheduled for the future or that need to be retried due to errors), jobs can be locked and fetched in batches, rather than one at a time.
233
+ + Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
234
+ + PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
235
+ - Other features introduced in this version include:
236
+ + Much better support for all versions of ActiveJob.
237
+ * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
238
+ + Custom middleware that wrap running jobs are now supported.
239
+ + Support for categorizing jobs with tags.
240
+ + Support for configuring a `maximum_retry_count` on individual job classes.
241
+ + Job configuration options are now inheritable, so job class hierarchies are more useful.
242
+ + There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
243
+ + Jobs that have finished working may optionally be retained in the database indefinitely.
244
+ * To keep a job record, replace the `destroy` calls in your jobs with `finish`. `destroy` will still delete records entirely, for jobs that you don't want to keep.
245
+ * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
246
+ * Finished jobs have a timestamp set in the finished_at column.
247
+ + Jobs that have errored too many times will now be marked as expired, and won't be retried again.
248
+ * You can configure a maximum_retry_count in your job classes, to set the threshold at which a job will be marked expired. The default is 15.
249
+ * To manually mark a job as expired (and keep it in the database but not try to run it again) you can call `expire` helper in your job.
250
+ + You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
251
+ + `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
252
+ + `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
253
+ - In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
254
+ + Support for MRI Rubies before 2.2 has been dropped.
255
+ + Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
256
+ + JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
257
+ + The `que:work` rake task has been removed. Use the `que` executable instead.
258
+ * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
259
+ + The `mode` setter has been removed.
260
+ * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
261
+ * To start up the worker pool (the old :async behavior) you should use the `que` executable to start up a worker process. There's no longer a supported API for running workers outside of the `que` executable.
262
+ + The following methods are not meaningful under the new implementation and have been removed:
263
+ * The `Que.wake_interval` getter and setter.
264
+ * The `Que.worker_count` getter and setter.
265
+ * `Que.wake!`
266
+ * `Que.wake_all!`
267
+ + Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
268
+ * It's not clear that anyone ever actually did this.
269
+ + `Que.worker_states` has been removed, as the connection that locks a job is no longer the one that the job is using to run. Its functionality has been partially replaced with `Que.job_states`.
270
+ + When using Rails, for simplicity, job attributes and keys in argument hashes are now converted to symbols when retrieved from the database, rather than being converted to instances of HashWithIndifferentAccess.
271
+ + Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
272
+ + Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
273
+ * It wouldn't have been a good idea to rely on this anyway.
274
+ + Calling Que.log() directly is no longer supported/recommended.
275
+ + Features marked as deprecated in the final 0.x releases have been removed.
276
+ - Finally, if you've built up your own tooling and customizations around Que, you may need to be aware of some DB schema changes made in the migration to schema version #4.
277
+ + The `job_id` column has been renamed `id` and is now the primary key. This makes it easier to manage the queue using an ActiveRecord model.
278
+ + Finished jobs are now kept in the DB, unless you explicitly call `destroy`. If you want to query the DB for only jobs that haven't finished yet, add a `WHERE finished_at IS NULL` condition to your query, or use the not_finished scope on one of the provided ORM models.
279
+ + There is now an `expired_at` timestamp column, which is set when a job reaches its maximum number of retries and will not be attempted again.
280
+ + Due to popular demand, the default queue name is now "default" rather than an empty string. The migration will move pending jobs under the "" queue to the "default" queue.
281
+ + The `last_error` column has been split in two, to `last_error_message` and `last_error_backtrace`. These two columns are now limited to 500 and 10,000 characters, respectively. The migration will split old error data correctly, and truncate it if necessary.
282
+ + Names for queues and job classes are now limited to 500 characters, which is still far longer than either of these values should reasonably be.
283
+ + There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
284
+
285
+ ## 0.14.3 (2018-03-02)
286
+
287
+ - Recorded errors now always include the error class, so that empty error messages can still be helpful. ( joehorsnell)
288
+ - Recorded error messages are now truncated to the first 500 characters.
289
+
290
+ ## 0.14.2 (2018-01-05)
291
+
292
+ - Deprecate the Que.disable_prepared_statements= accessors.
293
+ - Add Que.use_prepared_statements= configuration accessors.
294
+ - Update the generated Rails migration to declare a version. (NARKOZ)
303
295
 
304
- * The `Que.wake_interval` getter and setter.
296
+ ## 0.14.1 (2017-12-14)
305
297
 
306
- * The `Que.worker_count` getter and setter.
298
+ - Fix a bug with typecasting boolean values on Rails 5+.
307
299
 
308
- * `Que.wake!`
300
+ ## 0.14.0 (2017-08-11)
309
301
 
310
- * `Que.wake_all!`
302
+ - Fix incompatibility with Rails 5.1.
303
+ - Drop support for waking an in-process worker when an ActiveRecord transaction commits.
311
304
 
312
- * Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
305
+ ## 0.13.1 (2017-07-05)
313
306
 
314
- * It's not clear that anyone ever actually did this.
307
+ - Fix issue that caused error stacktraces to not be persisted in most cases.
315
308
 
316
- * `Que.worker_states` has been removed, as the connection that locks a job is no longer the one that the job is using to run. Its functionality has been partially replaced with `Que.job_states`.
309
+ ## 0.13.0 (2017-06-08)
317
310
 
318
- * When using Rails, for simplicity, job attributes and keys in argument hashes are now converted to symbols when retrieved from the database, rather than being converted to instances of HashWithIndifferentAccess.
311
+ - Fix recurring JSON issues by dropping MultiJson support. Previously MultiJson was detected and used automatically, and now it's just ignored and stdlib JSON used instead, so this shouldn't require any code changes.
319
312
 
320
- * Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
313
+ ## 0.12.3 (2017-06-01)
321
314
 
322
- * Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
315
+ - Fix incompatibility with MultiJson introduced by the previous release.
323
316
 
324
- * It wouldn't have been a good idea to rely on this anyway.
317
+ ## 0.12.2 (2017-06-01)
325
318
 
326
- * Calling Que.log() directly is no longer supported/recommended.
319
+ - Fix security vulnerability in parsing JSON from the DB (by specifying create_additions: false). This shouldn't be a concern unless you were passing untrusted user input in your job arguments. (hmac)
327
320
 
328
- * Features marked as deprecated in the final 0.x releases have been removed.
321
+ ## 0.12.1 (2017-01-22)
329
322
 
330
- * Finally, if you've built up your own tooling and customizations around Que, you may need to be aware of some DB schema changes made in the migration to schema version #4.
323
+ - Fix incompatibility with Rails 5.0. ([#166](https://github.com/que-rb/que/issues/166)) (nbibler, thedarkone)
331
324
 
332
- * The `job_id` column has been renamed `id` and is now the primary key. This makes it easier to manage the queue using an ActiveRecord model.
325
+ ## 0.12.0 (2016-09-09)
333
326
 
334
- * Finished jobs are now kept in the DB, unless you explicitly call `destroy`. If you want to query the DB for only jobs that haven't finished yet, add a `WHERE finished_at IS NULL` condition to your query, or use the not_finished scope on one of the provided ORM models.
327
+ - The error_handler configuration option has been renamed to error_notifier, which is more descriptive of what it's actually supposed to do. You can still use error_handler for configuration, but you'll get a warning.
328
+ - Introduced a new framework for handling errors on a per-job basis. See the docs for more information. ([#106](https://github.com/que-rb/que/pull/106), [#147](https://github.com/que-rb/que/issues/147))
335
329
 
336
- * There is now an `expired_at` timestamp column, which is set when a job reaches its maximum number of retries and will not be attempted again.
330
+ ## 0.11.6 (2016-07-01)
337
331
 
338
- * Due to popular demand, the default queue name is now "default" rather than an empty string. The migration will move pending jobs under the "" queue to the "default" queue.
332
+ - Fix for operating in nested transactions in Rails 5.0. ([#160](https://github.com/que-rb/que/pull/160)) (greysteil)
339
333
 
340
- * The `last_error` column has been split in two, to `last_error_message` and `last_error_backtrace`. These two columns are now limited to 500 and 10,000 characters, respectively. The migration will split old error data correctly, and truncate it if necessary.
334
+ ## 0.11.5 (2016-05-13)
341
335
 
342
- * Names for queues and job classes are now limited to 500 characters, which is still far longer than either of these values should reasonably be.
336
+ - Fix error when running `que -v`. ([#154](https://github.com/que-rb/que/pull/154)) (hardbap)
343
337
 
344
- * There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
338
+ ## 0.11.4 (2016-03-03)
345
339
 
346
- ---
340
+ - Fix incompatibility with ActiveRecord 5.0.0.beta3. ([#143](https://github.com/que-rb/que/issues/143), [#144](https://github.com/que-rb/que/pull/144)) (joevandyk)
347
341
 
348
- ### 0.14.3 (2018-03-02)
342
+ ## 0.11.3 (2016-02-26)
349
343
 
350
- * Recorded errors now always include the error class, so that empty error messages can still be helpful. ( joehorsnell)
344
+ - Fixed bug with displaying the current version of the que executable. ([#122](https://github.com/que-rb/que/pull/122)) (hardbap)
345
+ - Output to STDOUT when running via the executable or rake task is no longer buffered. This prevented logging in some cases. ([#129](https://github.com/que-rb/que/pull/129)) (hmarr)
346
+ - Officially added support for Ruby 2.2 and 2.3.
347
+ - String literals are now frozen on Ruby 2.3.
351
348
 
352
- * Recorded error messages are now truncated to the first 500 characters.
349
+ ## 0.11.2 (2015-09-09)
353
350
 
354
- ---
351
+ - Fix Job class constantizing when ActiveSupport isn't loaded. ([#121](https://github.com/que-rb/que/pull/121)) (godfat)
355
352
 
356
- ### 0.14.2 (2018-01-05)
353
+ ## 0.11.1 (2015-09-04)
357
354
 
358
- * Deprecate the Que.disable_prepared_statements= accessors.
355
+ - The `rake que:work` rake task that was specific to Rails has been deprecated and will be removed in Que 1.0. A deprecation warning will display when it is run.
359
356
 
360
- * Add Que.use_prepared_statements= configuration accessors.
357
+ ## 0.11.0 (2015-09-04)
361
358
 
362
- * Update the generated Rails migration to declare a version. (NARKOZ)
359
+ - A command-line program has been added that can be used to work jobs in a more flexible manner than the previous rake task. Run `que -h` for more information.
360
+ - The worker pool will no longer start automatically in the same process when running the rails server - this behavior was too prone to breakage. If you'd like to recreate the old behavior, you can manually set `Que.mode = :async` in your app whenever conditions are appropriate (classes have loaded, a database connection has been established, and the process will not be forking).
361
+ - Add a Que.disable_prepared_transactions= configuration option, to make it easier to use tools like pgbouncer. ([#110](https://github.com/que-rb/que/issues/110))
362
+ - Add a Que.json_converter= option, to configure how arguments are transformed before being passed to the job. By default this is set to the `Que::INDIFFERENTIATOR` proc, which provides simple indifferent access (via strings or symbols) to args hashes. If you're using Rails, the default is to convert the args to HashWithIndifferentAccess instead. You can also pass it the Que::SYMBOLIZER proc, which will destructively convert all keys in the args hash to symbols (this will probably be the default in Que 1.0). If you want to define a custom converter, you will usually want to pass this option a proc, and you'll probably want it to be recursive. See the implementations of Que::INDIFFERENTIATOR and Que::SYMBOLIZER for examples. ([#113](https://github.com/que-rb/que/issues/113))
363
+ - When using Que with ActiveRecord, workers now call `ActiveRecord::Base.clear_active_connections!` between jobs. This cleans up connections that ActiveRecord leaks when it is used to access mutliple databases. ([#116](https://github.com/que-rb/que/pull/116))
364
+ - If it exists, use String#constantize to constantize job classes, since ActiveSupport's constantize method behaves better with Rails' autoloading. ([#115](https://github.com/que-rb/que/issues/115), [#120](https://github.com/que-rb/que/pull/120)) (joevandyk)
363
365
 
364
- ---
366
+ ## 0.10.0 (2015-03-18)
365
367
 
366
- ### 0.14.1 (2017-12-14)
368
+ - When working jobs via the rake task, Rails applications are now eager-loaded if present, to avoid problems with multithreading and autoloading. ([#96](https://github.com/que-rb/que/pull/96)) (hmarr)
369
+ - The que:work rake task now uses whatever logger Que is configured to use normally, rather than forcing the use of STDOUT. ([#95](https://github.com/que-rb/que/issues/95))
370
+ - Add Que.transaction() helper method, to aid in transaction management in migrations or when the user's ORM doesn't provide one. ([#81](https://github.com/que-rb/que/issues/81))
367
371
 
368
- * Fix a bug with typecasting boolean values on Rails 5+.
372
+ ## 0.9.2 (2015-02-05)
369
373
 
370
- ---
374
+ - Fix a bug wherein the at_exit hook in the railtie wasn't waiting for jobs to finish before exiting.
375
+ - Fix a bug wherein the que:work rake task wasn't waiting for jobs to finish before exiting. ([#85](https://github.com/que-rb/que/pull/85)) (tycooon)
371
376
 
372
- ### 0.14.0 (2017-08-11)
377
+ ## 0.9.1 (2015-01-11)
373
378
 
374
- * Fix incompatibility with Rails 5.1.
379
+ - Use now() rather than 'now' when inserting jobs, to avoid using an old value as the default run_at in prepared statements. ([#74](https://github.com/que-rb/que/pull/74)) (bgentry)
375
380
 
376
- * Drop support for waking an in-process worker when an ActiveRecord transaction commits.
381
+ ## 0.9.0 (2014-12-16)
377
382
 
378
- ---
383
+ - The error_handler callable is now passed two objects, the error and the job that raised it. If your current error_handler is a proc, as recommended in the docs, you shouldn't need to make any code changes, unless you want to use the job in your error handling. If your error_handler is a lambda, or another callable with a strict arity requirement, you'll want to change it before upgrading. ([#69](https://github.com/que-rb/que/pull/69)) (statianzo)
379
384
 
380
- ### 0.13.1 (2017-07-05)
385
+ ## 0.8.2 (2014-10-12)
381
386
 
382
- * Fix issue that caused error stacktraces to not be persisted in most cases.
387
+ - Fix errors raised during rollbacks in the ActiveRecord adapter, which remained silent until Rails 4.2. ([#64](https://github.com/que-rb/que/pull/64), [#65](https://github.com/que-rb/que/pull/65)) (Strech)
383
388
 
384
- ---
389
+ ## 0.8.1 (2014-07-28)
385
390
 
386
- ### 0.13.0 (2017-06-08)
391
+ - Fix regression introduced in the `que:work` rake task by the `mode` / `worker_count` disentangling in 0.8.0. ([#50](https://github.com/que-rb/que/issues/50))
387
392
 
388
- * Fix recurring JSON issues by dropping MultiJson support. Previously MultiJson was detected and used automatically, and now it's just ignored and stdlib JSON used instead, so this shouldn't require any code changes.
393
+ ## 0.8.0 (2014-07-12)
389
394
 
390
- ---
395
+ - A callable can now be set as the logger, like `Que.logger = proc { MyLogger.new }`. Que uses this in its Railtie for cleaner initialization, but it is also available for public use.
396
+ - `Que.mode=` and `Que.worker_count=` now function independently. That is, setting the worker_count to a nonzero number no longer sets mode = :async (triggering the pool to start working jobs), and setting it to zero no longer sets mode = :off. Similarly, setting the mode to :async no longer sets the worker_count to 4 from 0, and setting the mode to :off no longer sets the worker_count to 0. This behavior was changed because it was interfering with configuration during initialization of Rails applications, and because it was unexpected. ([#47](https://github.com/que-rb/que/issues/47))
397
+ - Fixed a similar bug wherein setting a wake_interval during application startup would break worker awakening after the process was forked.
391
398
 
392
- ### 0.12.3 (2017-06-01)
399
+ ## 0.7.3 (2014-05-19)
393
400
 
394
- * Fix incompatibility with MultiJson introduced by the previous release.
401
+ - When mode = :sync, don't touch the database at all when running jobs inline. Needed for ActiveJob compatibility ([#46](https://github.com/que-rb/que/issues/46)).
395
402
 
396
- ### 0.12.2 (2017-06-01)
403
+ ## 0.7.2 (2014-05-18)
397
404
 
398
- * Fix security vulnerability in parsing JSON from the DB (by specifying create_additions: false). This shouldn't be a concern unless you were passing untrusted user input in your job arguments. (hmac)
405
+ - Fix issue wherein intermittent worker wakeups would not work after forking ([#44](https://github.com/que-rb/que/issues/44)).
399
406
 
400
- ---
407
+ ## 0.7.1 (2014-04-29)
401
408
 
402
- ### 0.12.1 (2017-01-22)
409
+ - Fix errors with prepared statements when ActiveRecord reconnects to the database. (dvrensk)
410
+ - Don't use prepared statements when inside a transaction. This negates the risk of a prepared statement error harming the entire transaction. The query that benefits the most from preparation is the job-lock CTE, which is never run in a transaction, so the performance impact should be negligible.
403
411
 
404
- * Fix incompatibility with Rails 5.0. (#166) (nbibler, thedarkone)
412
+ ## 0.7.0 (2014-04-09)
405
413
 
406
- ---
414
+ - `JobClass.queue(*args)` has been deprecated and will be removed in version 1.0.0. Please use `JobClass.enqueue(*args)` instead.
415
+ - The `@default_priority` and `@default_run_at` variables have been deprecated and will be removed in version 1.0.0. Please use `@priority` and `@run_at` instead, respectively.
416
+ - Log lines now include the process pid - its omission in the previous release was an oversight.
417
+ - The [Pond gem](https://github.com/chanks/pond) is now supported as a connection. It is very similar to the ConnectionPool gem, but creates connections lazily and is dynamically resizable.
407
418
 
408
- ### 0.12.0 (2016-09-09)
419
+ ## 0.6.0 (2014-02-04)
409
420
 
410
- * The error_handler configuration option has been renamed to error_notifier, which is more descriptive of what it's actually supposed to do. You can still use error_handler for configuration, but you'll get a warning.
421
+ - **A schema upgrade to version 3 is required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
422
+ - You can now run a job's logic directly (without enqueueing it) like `MyJob.run(arg1, arg2, other_arg: arg3)`. This is useful when a job class encapsulates logic that you want to invoke without involving the entire queue.
423
+ - You can now check the current version of Que's database schema with `Que.db_version`.
424
+ - The method for enqueuing a job has been renamed from `MyJob.queue` to `MyJob.enqueue`, since we were beginning to use the word 'queue' in a LOT of places. `MyJob.queue` still works, but it may be removed at some point.
425
+ - The variables for setting the defaults for a given job class have been changed from `@default_priority` to `@priority` and `@default_run_at` to `@run_at`. The old variables still work, but like `Job.queue`, they may be removed at some point.
426
+ - Log lines now include the machine's hostname, since a pid alone may not uniquely identify a process.
427
+ - Multiple queues are now supported. See [the docs](https://github.com/que-rb/que/blob/master/docs/multiple_queues.md) for details. (chanks, joevandyk)
428
+ - Rubinius 2.2 is now supported. (brixen)
429
+ - Job classes may now define their own logic for determining the retry interval when a job raises an error. See [error handling](https://github.com/que-rb/que/blob/master/docs/error_handling.md) for more information.
411
430
 
412
- * Introduced a new framework for handling errors on a per-job basis. See the docs for more information. (#106, #147)
431
+ ## 0.5.0 (2014-01-14)
413
432
 
414
- ---
415
-
416
- ### 0.11.6 (2016-07-01)
417
-
418
- * Fix for operating in nested transactions in Rails 5.0. (#160) (greysteil)
419
-
420
- ---
421
-
422
- ### 0.11.5 (2016-05-13)
423
-
424
- * Fix error when running `que -v`. (#154) (hardbap)
425
-
426
- ---
427
-
428
- ### 0.11.4 (2016-03-03)
429
-
430
- * Fix incompatibility with ActiveRecord 5.0.0.beta3. (#143, #144) (joevandyk)
431
-
432
- ---
433
-
434
- ### 0.11.3 (2016-02-26)
435
-
436
- * Fixed bug with displaying the current version of the que executable. (#122) (hardbap)
437
-
438
- * Output to STDOUT when running via the executable or rake task is no longer buffered. This prevented logging in some cases. (#129) (hmarr)
439
-
440
- * Officially added support for Ruby 2.2 and 2.3.
441
-
442
- * String literals are now frozen on Ruby 2.3.
443
-
444
- ---
445
-
446
- ### 0.11.2 (2015-09-09)
447
-
448
- * Fix Job class constantizing when ActiveSupport isn't loaded. (#121) (godfat)
449
-
450
- ---
451
-
452
- ### 0.11.1 (2015-09-04)
453
-
454
- * The `rake que:work` rake task that was specific to Rails has been deprecated and will be removed in Que 1.0. A deprecation warning will display when it is run.
455
-
456
- ---
457
-
458
- ### 0.11.0 (2015-09-04)
459
-
460
- * A command-line program has been added that can be used to work jobs in a more flexible manner than the previous rake task. Run `que -h` for more information.
461
-
462
- * The worker pool will no longer start automatically in the same process when running the rails server - this behavior was too prone to breakage. If you'd like to recreate the old behavior, you can manually set `Que.mode = :async` in your app whenever conditions are appropriate (classes have loaded, a database connection has been established, and the process will not be forking).
463
-
464
- * Add a Que.disable_prepared_transactions= configuration option, to make it easier to use tools like pgbouncer. (#110)
465
-
466
- * Add a Que.json_converter= option, to configure how arguments are transformed before being passed to the job. By default this is set to the `Que::INDIFFERENTIATOR` proc, which provides simple indifferent access (via strings or symbols) to args hashes. If you're using Rails, the default is to convert the args to HashWithIndifferentAccess instead. You can also pass it the Que::SYMBOLIZER proc, which will destructively convert all keys in the args hash to symbols (this will probably be the default in Que 1.0). If you want to define a custom converter, you will usually want to pass this option a proc, and you'll probably want it to be recursive. See the implementations of Que::INDIFFERENTIATOR and Que::SYMBOLIZER for examples. (#113)
467
-
468
- * When using Que with ActiveRecord, workers now call `ActiveRecord::Base.clear_active_connections!` between jobs. This cleans up connections that ActiveRecord leaks when it is used to access mutliple databases. (#116)
469
-
470
- * If it exists, use String#constantize to constantize job classes, since ActiveSupport's constantize method behaves better with Rails' autoloading. (#115, #120) (joevandyk)
471
-
472
- ---
473
-
474
- ### 0.10.0 (2015-03-18)
475
-
476
- * When working jobs via the rake task, Rails applications are now eager-loaded if present, to avoid problems with multithreading and autoloading. (#96) (hmarr)
477
-
478
- * The que:work rake task now uses whatever logger Que is configured to use normally, rather than forcing the use of STDOUT. (#95)
479
-
480
- * Add Que.transaction() helper method, to aid in transaction management in migrations or when the user's ORM doesn't provide one. (#81)
481
-
482
- ---
483
-
484
- ### 0.9.2 (2015-02-05)
485
-
486
- * Fix a bug wherein the at_exit hook in the railtie wasn't waiting for jobs to finish before exiting.
487
-
488
- * Fix a bug wherein the que:work rake task wasn't waiting for jobs to finish before exiting. (#85) (tycooon)
489
-
490
- ---
491
-
492
- ### 0.9.1 (2015-01-11)
493
-
494
- * Use now() rather than 'now' when inserting jobs, to avoid using an old value as the default run_at in prepared statements. (#74) (bgentry)
495
-
496
- ---
497
-
498
- ### 0.9.0 (2014-12-16)
499
-
500
- * The error_handler callable is now passed two objects, the error and the job that raised it. If your current error_handler is a proc, as recommended in the docs, you shouldn't need to make any code changes, unless you want to use the job in your error handling. If your error_handler is a lambda, or another callable with a strict arity requirement, you'll want to change it before upgrading. (#69) (statianzo)
501
-
502
- ---
503
-
504
- ### 0.8.2 (2014-10-12)
505
-
506
- * Fix errors raised during rollbacks in the ActiveRecord adapter, which remained silent until Rails 4.2. (#64, #65) (Strech)
507
-
508
- ---
509
-
510
- ### 0.8.1 (2014-07-28)
511
-
512
- * Fix regression introduced in the `que:work` rake task by the `mode` / `worker_count` disentangling in 0.8.0. (#50)
513
-
514
- ---
515
-
516
- ### 0.8.0 (2014-07-12)
517
-
518
- * A callable can now be set as the logger, like `Que.logger = proc { MyLogger.new }`. Que uses this in its Railtie for cleaner initialization, but it is also available for public use.
519
-
520
- * `Que.mode=` and `Que.worker_count=` now function independently. That is, setting the worker_count to a nonzero number no longer sets mode = :async (triggering the pool to start working jobs), and setting it to zero no longer sets mode = :off. Similarly, setting the mode to :async no longer sets the worker_count to 4 from 0, and setting the mode to :off no longer sets the worker_count to 0. This behavior was changed because it was interfering with configuration during initialization of Rails applications, and because it was unexpected. (#47)
521
-
522
- * Fixed a similar bug wherein setting a wake_interval during application startup would break worker awakening after the process was forked.
523
-
524
- ---
525
-
526
- ### 0.7.3 (2014-05-19)
527
-
528
- * When mode = :sync, don't touch the database at all when running jobs inline. Needed for ActiveJob compatibility (#46).
529
-
530
- ---
531
-
532
- ### 0.7.2 (2014-05-18)
533
-
534
- * Fix issue wherein intermittent worker wakeups would not work after forking (#44).
535
-
536
- ---
537
-
538
- ### 0.7.1 (2014-04-29)
539
-
540
- * Fix errors with prepared statements when ActiveRecord reconnects to the database. (dvrensk)
541
-
542
- * Don't use prepared statements when inside a transaction. This negates the risk of a prepared statement error harming the entire transaction. The query that benefits the most from preparation is the job-lock CTE, which is never run in a transaction, so the performance impact should be negligible.
543
-
544
- ---
545
-
546
- ### 0.7.0 (2014-04-09)
547
-
548
- * `JobClass.queue(*args)` has been deprecated and will be removed in version 1.0.0. Please use `JobClass.enqueue(*args)` instead.
549
-
550
- * The `@default_priority` and `@default_run_at` variables have been deprecated and will be removed in version 1.0.0. Please use `@priority` and `@run_at` instead, respectively.
551
-
552
- * Log lines now include the process pid - its omission in the previous release was an oversight.
553
-
554
- * The [Pond gem](https://github.com/chanks/pond) is now supported as a connection. It is very similar to the ConnectionPool gem, but creates connections lazily and is dynamically resizable.
555
-
556
- ---
557
-
558
- ### 0.6.0 (2014-02-04)
559
-
560
- * **A schema upgrade to version 3 is required for this release.** See [the migration doc](https://github.com/que-rb/que/blob/master/docs/migrating.md) for information if you're upgrading from a previous release.
561
-
562
- * You can now run a job's logic directly (without enqueueing it) like `MyJob.run(arg1, arg2, other_arg: arg3)`. This is useful when a job class encapsulates logic that you want to invoke without involving the entire queue.
563
-
564
- * You can now check the current version of Que's database schema with `Que.db_version`.
565
-
566
- * The method for enqueuing a job has been renamed from `MyJob.queue` to `MyJob.enqueue`, since we were beginning to use the word 'queue' in a LOT of places. `MyJob.queue` still works, but it may be removed at some point.
567
-
568
- * The variables for setting the defaults for a given job class have been changed from `@default_priority` to `@priority` and `@default_run_at` to `@run_at`. The old variables still work, but like `Job.queue`, they may be removed at some point.
569
-
570
- * Log lines now include the machine's hostname, since a pid alone may not uniquely identify a process.
571
-
572
- * Multiple queues are now supported. See [the docs](https://github.com/que-rb/que/blob/master/docs/multiple_queues.md) for details. (chanks, joevandyk)
573
-
574
- * Rubinius 2.2 is now supported. (brixen)
575
-
576
- * Job classes may now define their own logic for determining the retry interval when a job raises an error. See [error handling](https://github.com/que-rb/que/blob/master/docs/error_handling.md) for more information.
577
-
578
- ---
579
-
580
- ### 0.5.0 (2014-01-14)
581
-
582
- * When running a worker pool inside your web process on ActiveRecord, Que will now wake a worker once a transaction containing a queued job is committed. (joevandyk, chanks)
583
-
584
- * The `que:work` rake task now has a default wake_interval of 0.1 seconds, since it relies exclusively on polling to pick up jobs. You can set a QUE_WAKE_INTERVAL environment variable to change this. The environment variable to set a size for the worker pool in the rake task has also been changed from WORKER_COUNT to QUE_WORKER_COUNT.
585
-
586
- * Officially support Ruby 1.9.3. Note that due to the Thread#kill problems (see "Remove Que.stop!" below) there's a danger of data corruption when running under 1.9, though.
587
-
588
- * The default priority for jobs is now 100 (it was 1 before). Like always (and like delayed_job), a lower priority means it's more important. You can migrate the schema version to 2 to set the new default value on the que_jobs table, though it's only necessary if you're doing your own INSERTs - if you use `MyJob.queue`, it's already taken care of.
589
-
590
- * Added a migration system to make it easier to change the schema when updating Que. You can now write, for example, `Que.migrate!(version: 2)` in your migrations. Migrations are run transactionally.
591
-
592
- * The logging format has changed to be more easily machine-readable. You can also now customize the logging format by assigning a callable to Que.log_formatter=. See the new doc on [logging](https://github.com/que-rb/que/blob/master/docs/logging.md)) for details. The default logger level is INFO - for less critical information (such as when no jobs were found to be available or when a job-lock race condition has been detected and avoided) you can set the QUE_LOG_LEVEL environment variable to DEBUG.
593
-
594
- * MultiJson is now a soft dependency. Que will use it if it is available, but it is not required.
595
-
596
- * Remove Que.stop!.
433
+ - When running a worker pool inside your web process on ActiveRecord, Que will now wake a worker once a transaction containing a queued job is committed. (joevandyk, chanks)
434
+ - The `que:work` rake task now has a default wake_interval of 0.1 seconds, since it relies exclusively on polling to pick up jobs. You can set a QUE_WAKE_INTERVAL environment variable to change this. The environment variable to set a size for the worker pool in the rake task has also been changed from WORKER_COUNT to QUE_WORKER_COUNT.
435
+ - Officially support Ruby 1.9.3. Note that due to the Thread#kill problems (see "Remove Que.stop!" below) there's a danger of data corruption when running under 1.9, though.
436
+ - The default priority for jobs is now 100 (it was 1 before). Like always (and like delayed_job), a lower priority means it's more important. You can migrate the schema version to 2 to set the new default value on the que_jobs table, though it's only necessary if you're doing your own INSERTs - if you use `MyJob.queue`, it's already taken care of.
437
+ - Added a migration system to make it easier to change the schema when updating Que. You can now write, for example, `Que.migrate!(version: 2)` in your migrations. Migrations are run transactionally.
438
+ - The logging format has changed to be more easily machine-readable. You can also now customize the logging format by assigning a callable to Que.log_formatter=. See the new doc on [logging](https://github.com/que-rb/que/blob/master/docs/logging.md)) for details. The default logger level is INFO - for less critical information (such as when no jobs were found to be available or when a job-lock race condition has been detected and avoided) you can set the QUE_LOG_LEVEL environment variable to DEBUG.
439
+ - MultiJson is now a soft dependency. Que will use it if it is available, but it is not required.
440
+ - Remove Que.stop!.
597
441
 
598
442
  Using Thread#raise to kill workers is a bad idea - the results are unpredictable and nearly impossible to spec reliably. Its purpose was to prevent premature commits in ActiveRecord/Sequel when a thread is killed during shutdown, but it's possible to detect that situation on Ruby 2.0+, so this is really better handled by the ORMs directly. See the pull requests for [Sequel](https://github.com/jeremyevans/sequel/pull/752) and [ActiveRecord](https://github.com/rails/rails/pull/13656).
599
443
 
600
444
  Now, when a process exits, if the worker pool is running (whether in a rake task or in a web process) the exit will be stalled until all workers have finished their current jobs. If you have long-running jobs, this may take a long time. If you need the process to exit immediately, you can SIGKILL without any threat of commiting prematurely.
601
445
 
602
- ---
446
+ ## 0.4.0 (2014-01-05)
603
447
 
604
- ### 0.4.0 (2014-01-05)
605
-
606
- * Que.wake_all! was added, as a simple way to wake up all workers in the pool.
607
-
608
- * Que.sleep_period was renamed to the more descriptive Que.wake_interval.
609
-
610
- * When queueing a job, Que will wait until the current transaction commits and then wake a background worker, if possible. This allows newly queued jobs to be started immediately instead of waiting for a worker to wake up and poll, which may be up to `Que.wake_interval` seconds.
448
+ - Que.wake_all! was added, as a simple way to wake up all workers in the pool.
449
+ - Que.sleep_period was renamed to the more descriptive Que.wake_interval.
450
+ - When queueing a job, Que will wait until the current transaction commits and then wake a background worker, if possible. This allows newly queued jobs to be started immediately instead of waiting for a worker to wake up and poll, which may be up to `Que.wake_interval` seconds.
611
451
 
612
452
  This feature currently only works with Sequel, since there doesn't seem to be a clean way to do it on ActiveRecord (if anyone can figure one out, please let me know). Note that if you're using ActiveRecord, you can always manually trigger a single worker to wake up and check for work by manually calling Que.wake! after your transaction completes.
453
+ - Add Que.job_stats, which queries the database and returns statistics on the different job classes - for each class, how many are queued, how many are currently being worked, what is the highest error_count, and so on.
454
+ - Add Que.worker_states, which queries the database and returns all currently-locked jobs and info on their workers' connections - what and when was the last query they ran, are they waiting on locks, and so on.
455
+ - Have Que only clear advisory locks that it has taken when locking jobs, and not touch any that may have been taken by other code using the same connection.
456
+ - Add Que.worker_count, to retrieve the current number of workers in the pool of the current process.
457
+ - Much more internal cleanup.
613
458
 
614
- * Add Que.job_stats, which queries the database and returns statistics on the different job classes - for each class, how many are queued, how many are currently being worked, what is the highest error_count, and so on.
615
-
616
- * Add Que.worker_states, which queries the database and returns all currently-locked jobs and info on their workers' connections - what and when was the last query they ran, are they waiting on locks, and so on.
617
-
618
- * Have Que only clear advisory locks that it has taken when locking jobs, and not touch any that may have been taken by other code using the same connection.
619
-
620
- * Add Que.worker_count, to retrieve the current number of workers in the pool of the current process.
621
-
622
- * Much more internal cleanup.
459
+ ## 0.3.0 (2013-12-21)
623
460
 
624
- ---
625
-
626
- ### 0.3.0 (2013-12-21)
627
-
628
- * Add Que.stop!, which immediately kills all jobs being worked in the process.
461
+ - Add Que.stop!, which immediately kills all jobs being worked in the process.
629
462
 
630
463
  This can leave database connections and such in an unpredictable state, and so should only be used when the process is exiting.
631
-
632
- * Use Que.stop! to safely handle processes that exit while Que is running.
464
+ - Use Que.stop! to safely handle processes that exit while Que is running.
633
465
 
634
466
  Previously, a job that was in the middle of a transaction when the process was killed with SIGINT or SIGTERM would have had its work committed prematurely.
467
+ - Clean up internals and hammer out several race conditions.
635
468
 
636
- * Clean up internals and hammer out several race conditions.
637
-
638
- ---
469
+ ## 0.2.0 (2013-11-30)
639
470
 
640
- ### 0.2.0 (2013-11-30)
641
-
642
- * Officially support JRuby 1.7.5+. Earlier versions may work.
471
+ - Officially support JRuby 1.7.5+. Earlier versions may work.
643
472
 
644
473
  JRuby support requires the use of the `jruby-pg` gem, though that gem seems to currently be incompatible with ActiveRecord, so the ActiveRecord adapter specs don't pass (or even run). It works fine with Sequel and the other adapters, though.
474
+ - Officially support Rubinius 2.1.1+. Earlier versions may work.
475
+ - Use `multi_json` so we always use the fastest JSON parser available. (BukhariH)
476
+ - :sync mode now ignores scheduled jobs (jobs queued with a specific run_at).
645
477
 
646
- * Officially support Rubinius 2.1.1+. Earlier versions may work.
647
-
648
- * Use `multi_json` so we always use the fastest JSON parser available. (BukhariH)
649
-
650
- * :sync mode now ignores scheduled jobs (jobs queued with a specific run_at).
651
-
652
- ---
653
-
654
- ### 0.1.0 (2013-11-18)
655
-
656
- * Initial public release, after a test-driven rewrite.
657
-
658
- Officially support Ruby 2.0.0 and Postgres 9.2+.
659
-
660
- Also support ActiveRecord and bare PG::Connections, in or out of a ConnectionPool.
661
-
662
- Added a Railtie for easier setup with Rails, as well as a migration generator.
478
+ ## 0.1.0 (2013-11-18)
663
479
 
664
- ---
480
+ - Initial public release, after a test-driven rewrite.
481
+ - Officially support Ruby 2.0.0 and Postgres 9.2+.
482
+ - Also support ActiveRecord and bare PG::Connections, in or out of a ConnectionPool.
483
+ - Added a Railtie for easier setup with Rails, as well as a migration generator.
665
484
 
666
- ### 0.0.1 (2013-11-07)
485
+ ## 0.0.1 (2013-11-07)
667
486
 
668
- * Copy-pasted from an app of mine. Very Sequel-specific. Nobody look at it, let's pretend it never happened.
487
+ - Copy-pasted from an app of mine. Very Sequel-specific. Nobody look at it, let's pretend it never happened.
@@ -138,10 +138,9 @@ module Que
138
138
  opts.on(
139
139
  '--minimum-buffer-size [SIZE]',
140
140
  Integer,
141
- "Set minimum number of jobs to be locked and held in this " \
142
- "process awaiting a worker (default: 2)",
141
+ "Unused (deprecated)",
143
142
  ) do |s|
144
- options[:minimum_buffer_size] = s
143
+ warn "The --minimum-buffer-size SIZE option has been deprecated and will be removed in v2.0 (it's actually been unused since v1.0.0.beta4)"
145
144
  end
146
145
 
147
146
  opts.on(
@@ -236,7 +235,7 @@ OUTPUT
236
235
  <<~STARTUP
237
236
  Que #{Que::VERSION} started worker process with:
238
237
  Worker threads: #{locker.workers.length} (priorities: #{locker.workers.map { |w| w.priority || 'any' }.join(', ')})
239
- Buffer size: #{locker.job_buffer.minimum_size}-#{locker.job_buffer.maximum_size}
238
+ Buffer size: #{locker.job_buffer.maximum_size}
240
239
  Queues:
241
240
  #{locker.queues.map { |queue, interval| " - #{queue} (poll interval: #{interval}s)" }.join("\n")}
242
241
  Que waiting for jobs...
data/docs/README.md CHANGED
@@ -4,7 +4,7 @@ Docs Index
4
4
  - [Command Line Interface](#command-line-interface)
5
5
  * [worker-priorities and worker-count](#worker-priorities-and-worker-count)
6
6
  * [poll-interval](#poll-interval)
7
- * [minimum-buffer-size and maximum-buffer-size](#minimum-buffer-size-and-maximum-buffer-size)
7
+ * [maximum-buffer-size](#maximum-buffer-size)
8
8
  * [connection-url](#connection-url)
9
9
  * [wait-period](#wait-period)
10
10
  * [log-internals](#log-internals)
@@ -62,7 +62,6 @@ usage: que [options] [file/to/require] ...
62
62
  --connection-url [URL] Set a custom database url to connect to for locking purposes.
63
63
  --log-internals Log verbosely about Que's internal state. Only recommended for debugging issues
64
64
  --maximum-buffer-size [SIZE] Set maximum number of jobs to be locked and held in this process awaiting a worker (default: 8)
65
- --minimum-buffer-size [SIZE] Set minimum number of jobs to be locked and held in this process awaiting a worker (default: 2)
66
65
  --wait-period [PERIOD] Set maximum interval between checks of the in-memory job queue, in milliseconds (default: 50)
67
66
  ```
68
67
 
@@ -82,9 +81,9 @@ If you pass both worker-count and worker-priorities, the count will trim or pad
82
81
 
83
82
  This option sets the number of seconds the process will wait between polls of the job queue. Jobs that are ready to be worked immediately will be broadcast via the LISTEN/NOTIFY system, so polling is unnecessary for them - polling is only necessary for jobs that are scheduled in the future or which are being delayed due to errors. The default is 5 seconds.
84
83
 
85
- ### minimum-buffer-size and maximum-buffer-size
84
+ ### maximum-buffer-size
86
85
 
87
- These options set the size of the internal buffer that Que uses to hold jobs until they're ready for workers. The default minimum is 2 and the maximum is 8, meaning that the process won't buffer more than 8 jobs that aren't yet ready to be worked, and will only resort to polling if the buffer dips below 2. If you don't want jobs to be buffered at all, you can set both of these values to zero.
86
+ This option sets the size of the internal buffer that Que uses to hold jobs until they're ready for workers. The default maximum is 8, meaning that the process won't buffer more than 8 jobs that aren't yet ready to be worked. If you don't want jobs to be buffered at all, you can set this value to zero.
88
87
 
89
88
  ### connection-url
90
89
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  module Que
8
8
  class JobBuffer
9
- attr_reader :maximum_size, :minimum_size, :priority_queues
9
+ attr_reader :maximum_size, :priority_queues
10
10
 
11
11
  # Since we use a mutex, which is not reentrant, we have to be a little
12
12
  # careful to not call a method that locks the mutex when we've already
@@ -17,20 +17,11 @@ module Que
17
17
 
18
18
  def initialize(
19
19
  maximum_size:,
20
- minimum_size:,
21
20
  priorities:
22
21
  )
23
22
  @maximum_size = Que.assert(Integer, maximum_size)
24
23
  Que.assert(maximum_size >= 0) { "maximum_size for a JobBuffer must be at least zero!" }
25
24
 
26
- @minimum_size = Que.assert(Integer, minimum_size)
27
- Que.assert(minimum_size >= 0) { "minimum_size for a JobBuffer must be at least zero!" }
28
-
29
- Que.assert(minimum_size <= maximum_size) do
30
- "minimum buffer size (#{minimum_size}) is " \
31
- "greater than the maximum buffer size (#{maximum_size})!"
32
- end
33
-
34
25
  @stop = false
35
26
  @array = []
36
27
  @mutex = Mutex.new
data/lib/que/locker.rb CHANGED
@@ -45,7 +45,6 @@ module Que
45
45
 
46
46
  DEFAULT_POLL_INTERVAL = 5.0
47
47
  DEFAULT_WAIT_PERIOD = 50
48
- DEFAULT_MINIMUM_BUFFER_SIZE = 2
49
48
  DEFAULT_MAXIMUM_BUFFER_SIZE = 8
50
49
  DEFAULT_WORKER_PRIORITIES = [10, 30, 50, nil, nil, nil].freeze
51
50
 
@@ -57,7 +56,6 @@ module Que
57
56
  poll_interval: DEFAULT_POLL_INTERVAL,
58
57
  wait_period: DEFAULT_WAIT_PERIOD,
59
58
  maximum_buffer_size: DEFAULT_MAXIMUM_BUFFER_SIZE,
60
- minimum_buffer_size: DEFAULT_MINIMUM_BUFFER_SIZE,
61
59
  worker_priorities: DEFAULT_WORKER_PRIORITIES,
62
60
  on_worker_start: nil
63
61
  )
@@ -77,7 +75,6 @@ module Que
77
75
  # ResultQueue to receive messages from workers.
78
76
  @job_buffer = JobBuffer.new(
79
77
  maximum_size: maximum_buffer_size,
80
- minimum_size: minimum_buffer_size,
81
78
  priorities: worker_priorities.uniq,
82
79
  )
83
80
 
@@ -93,7 +90,6 @@ module Que
93
90
  poll_interval: poll_interval,
94
91
  wait_period: wait_period,
95
92
  maximum_buffer_size: maximum_buffer_size,
96
- minimum_buffer_size: minimum_buffer_size,
97
93
  worker_priorities: worker_priorities,
98
94
  }
99
95
  end
data/lib/que/poller.rb CHANGED
@@ -146,8 +146,6 @@ module Que
146
146
 
147
147
  return unless should_poll?
148
148
 
149
- expected_count = priorities.inject(0){|s,(_,c)| s + c}
150
-
151
149
  jobs =
152
150
  connection.execute_prepared(
153
151
  :poll_jobs,
@@ -159,7 +157,7 @@ module Que
159
157
  )
160
158
 
161
159
  @last_polled_at = Time.now
162
- @last_poll_satisfied = expected_count == jobs.count
160
+ @last_poll_satisfied = poll_satisfied?(priorities, jobs)
163
161
 
164
162
  Que.internal_log :poller_polled, self do
165
163
  {
@@ -265,5 +263,12 @@ module Que
265
263
  SQL
266
264
  end
267
265
  end
266
+
267
+ private
268
+
269
+ def poll_satisfied?(priorities, jobs)
270
+ lowest_priority = priorities.keys.max
271
+ jobs.count >= priorities[lowest_priority]
272
+ end
268
273
  end
269
274
  end
data/lib/que/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Que
4
- VERSION = '1.3.1'
4
+ VERSION = '1.4.0'
5
5
 
6
6
  def self.job_schema_version
7
7
  1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hanks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-25 00:00:00.000000000 Z
11
+ date: 2022-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubygems_version: 3.3.6
112
+ rubygems_version: 3.3.7
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: A PostgreSQL-based Job Queue