que 1.3.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,4 +1,81 @@
1
- ### 1.3.0 (2022-02-25)
1
+ # Changelog
2
+
3
+ <!-- MarkdownTOC autolink=true -->
4
+
5
+ - [1.4.1 \(2022-07-24\)](#141-2022-07-24)
6
+ - [1.4.0 \(2022-03-23\)](#140-2022-03-23)
7
+ - [1.3.1 \(2022-02-25\)](#131-2022-02-25)
8
+ - [1.3.0 \(2022-02-25\)](#130-2022-02-25)
9
+ - [1.2.0 \(2022-02-23\)](#120-2022-02-23)
10
+ - [1.1.0 \(2022-02-21\)](#110-2022-02-21)
11
+ - [1.0.0 \(2022-01-24\)](#100-2022-01-24)
12
+ - [1.0.0.beta5 \(2021-12-23\)](#100beta5-2021-12-23)
13
+ - [1.0.0.beta4 \(2020-01-17\)](#100beta4-2020-01-17)
14
+ - [1.0.0.beta3 \(2018-05-18\)](#100beta3-2018-05-18)
15
+ - [1.0.0.beta2 \(2018-04-13\)](#100beta2-2018-04-13)
16
+ - [1.0.0.beta \(2017-10-25\)](#100beta-2017-10-25)
17
+ - [0.14.3 \(2018-03-02\)](#0143-2018-03-02)
18
+ - [0.14.2 \(2018-01-05\)](#0142-2018-01-05)
19
+ - [0.14.1 \(2017-12-14\)](#0141-2017-12-14)
20
+ - [0.14.0 \(2017-08-11\)](#0140-2017-08-11)
21
+ - [0.13.1 \(2017-07-05\)](#0131-2017-07-05)
22
+ - [0.13.0 \(2017-06-08\)](#0130-2017-06-08)
23
+ - [0.12.3 \(2017-06-01\)](#0123-2017-06-01)
24
+ - [0.12.2 \(2017-06-01\)](#0122-2017-06-01)
25
+ - [0.12.1 \(2017-01-22\)](#0121-2017-01-22)
26
+ - [0.12.0 \(2016-09-09\)](#0120-2016-09-09)
27
+ - [0.11.6 \(2016-07-01\)](#0116-2016-07-01)
28
+ - [0.11.5 \(2016-05-13\)](#0115-2016-05-13)
29
+ - [0.11.4 \(2016-03-03\)](#0114-2016-03-03)
30
+ - [0.11.3 \(2016-02-26\)](#0113-2016-02-26)
31
+ - [0.11.2 \(2015-09-09\)](#0112-2015-09-09)
32
+ - [0.11.1 \(2015-09-04\)](#0111-2015-09-04)
33
+ - [0.11.0 \(2015-09-04\)](#0110-2015-09-04)
34
+ - [0.10.0 \(2015-03-18\)](#0100-2015-03-18)
35
+ - [0.9.2 \(2015-02-05\)](#092-2015-02-05)
36
+ - [0.9.1 \(2015-01-11\)](#091-2015-01-11)
37
+ - [0.9.0 \(2014-12-16\)](#090-2014-12-16)
38
+ - [0.8.2 \(2014-10-12\)](#082-2014-10-12)
39
+ - [0.8.1 \(2014-07-28\)](#081-2014-07-28)
40
+ - [0.8.0 \(2014-07-12\)](#080-2014-07-12)
41
+ - [0.7.3 \(2014-05-19\)](#073-2014-05-19)
42
+ - [0.7.2 \(2014-05-18\)](#072-2014-05-18)
43
+ - [0.7.1 \(2014-04-29\)](#071-2014-04-29)
44
+ - [0.7.0 \(2014-04-09\)](#070-2014-04-09)
45
+ - [0.6.0 \(2014-02-04\)](#060-2014-02-04)
46
+ - [0.5.0 \(2014-01-14\)](#050-2014-01-14)
47
+ - [0.4.0 \(2014-01-05\)](#040-2014-01-05)
48
+ - [0.3.0 \(2013-12-21\)](#030-2013-12-21)
49
+ - [0.2.0 \(2013-11-30\)](#020-2013-11-30)
50
+ - [0.1.0 \(2013-11-18\)](#010-2013-11-18)
51
+ - [0.0.1 \(2013-11-07\)](#001-2013-11-07)
52
+
53
+ <!-- /MarkdownTOC -->
54
+
55
+ ## 1.4.1 (2022-07-24)
56
+
57
+ - **Added**
58
+ + Added Ruby version requirement of < 3. For Ruby 3 compatibility, upgrade to Que 2 - [upgrade process](https://github.com/que-rb/que/blob/master/CHANGELOG.md#200beta1-2022-03-24)
59
+
60
+ ## 1.4.0 (2022-03-23)
61
+
62
+ - **Fixed**
63
+ + 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).
64
+ * 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)
65
+ - **Deprecated**:
66
+ + 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)
67
+ * It became used in 1.0.0.beta4, and that changelog entry has been updated to reflect this.
68
+ - **Documentation**:
69
+ + Reformatted the changelog to be more consistent, including adding links to all issue/PR numbers. [#347](https://github.com/que-rb/que/pull/347)
70
+
71
+ ## 1.3.1 (2022-02-25)
72
+
73
+ Unfortunately, v1.3.0 was broken. Follow its upgrade instructions, but use this version instead.
74
+
75
+ - **Fixed**
76
+ + Fixed startup error: `undefined method 'job_schema_version' for Que:Module`, in [#343](https://github.com/que-rb/que/pull/343)
77
+
78
+ ## 1.3.0 (2022-02-25)
2
79
 
3
80
  **ACTION REQUIRED**
4
81
 
@@ -29,625 +106,388 @@ You must apply the schema migration and deploy to upgrade all workers.
29
106
 
30
107
  No further action is required from you at this stage. The Que 2 release changelog will provide full upgrade instructions for the process briefly described above of simultaneously running both Que 1 & 2 workers. Note that you won't be required to upgrade from Ruby 2.7 to Ruby 3 at the same time as upgrading to Que 2.
31
108
 
32
- If you use any Que plugins or custom code that interacts with the `que_jobs` table, before you can upgrade to Que 2, you will need to make sure they are updated for compatibility with Que 2: They'll need to make use of the `kwargs` column, and when inserting jobs, put the result of `Que.job_schema_version` into the `job_schema_version` column rather than continue to rely on its default of `1`.
109
+ If you use any Que plugins or custom code that interacts with the `que_jobs` table, before you can upgrade to Que 2, you will need to make sure they are updated for compatibility with Que 2: They'll need to make use of the `kwargs` column, and when inserting jobs, put a `2` into the `job_schema_version` column rather than continue to rely on its soon-to-be-removed default of `1`.
33
110
 
34
- ### 1.2.0 (2022-02-23)
111
+ **Other improvements**:
112
+
113
+ - **Features**:
114
+ + Log config on startup, in [#337](https://github.com/que-rb/que/pull/337)
115
+ - **Internal**:
116
+ + Added Git pre-push hook, in [#338](https://github.com/que-rb/que/pull/338)
117
+ + Documented our gem release process, in [#341](https://github.com/que-rb/que/pull/341)
118
+
119
+ ## 1.2.0 (2022-02-23)
35
120
 
36
121
  - **Deprecated**
37
122
  + 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)
38
123
 
39
- ### 1.1.0 (2022-02-21)
124
+ ## 1.1.0 (2022-02-21)
40
125
 
41
126
  - **Features**:
42
127
  + Add backtrace to errors, by [@trammel](https://github.com/trammel) in [#328](https://github.com/que-rb/que/pull/328)
43
128
  - **Internal**:
44
129
  + Add Dockerised development environment, in [#324](https://github.com/que-rb/que/pull/324)
45
130
 
46
- ### 1.0.0 (2022-01-24)
131
+ ## 1.0.0 (2022-01-24)
47
132
 
48
133
  _This release does not add any changes on top of 1.0.0.beta5._
49
134
 
50
- ### 1.0.0.beta5 (2021-12-23)
51
-
52
- * **Bug fixes and improvements**
53
- * 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)
54
- * Fix lock leak on PostgreSQL 12 and later by [@jasoncodes](https://github.com/jasoncodes) in [#298](https://github.com/que-rb/que/pull/298)
55
- * Fix deadlock issue [#318](https://github.com/que-rb/que/pull/318)
56
- * Fix thread attrition issue [#321](https://github.com/que-rb/que/pull/321)
57
-
58
- * **Rails fixes:**
59
- * Set schema in table_name for ActiveRecord model by [@nikitug](https://github.com/nikitug) in [#274](https://github.com/que-rb/que/pull/274)
60
-
61
- * **Documentation:**
62
- * 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)
135
+ ## 1.0.0.beta5 (2021-12-23)
136
+
137
+ - **Bug fixes and improvements**
138
+ + 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)
139
+ + Fix lock leak on PostgreSQL 12 and later by [@jasoncodes](https://github.com/jasoncodes) in [#298](https://github.com/que-rb/que/pull/298)
140
+ + Fix deadlock issue [#318](https://github.com/que-rb/que/pull/318)
141
+ + Fix thread attrition issue [#321](https://github.com/que-rb/que/pull/321)
142
+ - **Rails fixes:**
143
+ + Set schema in table_name for ActiveRecord model by [@nikitug](https://github.com/nikitug) in [#274](https://github.com/que-rb/que/pull/274)
144
+ - **Documentation:**
145
+ + 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)
63
146
  [`5259303`](https://github.com/que-rb/que/commit/52593031a7eef2d52ac38eceb2d8df776ec74090)
64
- * Fix links to Writing Reliable Jobs by [@nikitug](https://github.com/nikitug) in [#273](https://github.com/que-rb/que/pull/273)
65
- * Add build badge to README by [@jonathanhefner](https://github.com/jonathanhefner) in [#278](https://github.com/que-rb/que/pull/278)
66
- * Fix ToC links in docs by [@swrobel](https://github.com/swrobel) in [#287](https://github.com/que-rb/que/pull/287)
67
- * 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)
68
- * Add instructions for how to start Que by [@xcskier56](https://github.com/xcskier56) in [#292](https://github.com/que-rb/que/pull/292)
69
-
70
- * **CI/tests**
71
- * Fix CI failure from Docker Postgres image by [@jonathanhefner](https://github.com/jonathanhefner) in [#275](https://github.com/que-rb/que/pull/275)
72
- * Test with Ruby 2.7 by [@jonathanhefner](https://github.com/jonathanhefner) in [#276](https://github.com/que-rb/que/pull/276)
73
- * Run GitHub build workflow on push by [@jonathanhefner](https://github.com/jonathanhefner) in [#277](https://github.com/que-rb/que/pull/277)
74
-
75
-
147
+ + Fix links to Writing Reliable Jobs by [@nikitug](https://github.com/nikitug) in [#273](https://github.com/que-rb/que/pull/273)
148
+ + Add build badge to README by [@jonathanhefner](https://github.com/jonathanhefner) in [#278](https://github.com/que-rb/que/pull/278)
149
+ + Fix ToC links in docs by [@swrobel](https://github.com/swrobel) in [#287](https://github.com/que-rb/que/pull/287)
150
+ + 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)
151
+ + Add instructions for how to start Que by [@xcskier56](https://github.com/xcskier56) in [#292](https://github.com/que-rb/que/pull/292)
152
+ - **CI/tests**
153
+ + Fix CI failure from Docker Postgres image by [@jonathanhefner](https://github.com/jonathanhefner) in [#275](https://github.com/que-rb/que/pull/275)
154
+ + Test with Ruby 2.7 by [@jonathanhefner](https://github.com/jonathanhefner) in [#276](https://github.com/que-rb/que/pull/276)
155
+ + Run GitHub build workflow on push by [@jonathanhefner](https://github.com/jonathanhefner) in [#277](https://github.com/que-rb/que/pull/277)
76
156
  **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)
77
-
78
157
  **Unless an issue is found we intend for this release to become v1.0.0 proper.**
79
158
 
80
- ---
81
-
82
- ### 1.0.0.beta4 (2020-01-17)
83
-
84
- - Rails 6 compatibility: Fix time parsing #249 and https://github.com/que-rb/que/commit/5ddddd5ebac6153d7a683ef08c86bced8e03fb51
85
- - Cleaner sequel usage #257
86
- - Documentation improvements #264 #269 #261 #231
87
-
88
- ---
89
-
90
- ### 1.0.0.beta3 (2018-05-18)
91
-
92
- * Added support for customizing log levels for `job_worked` events (#217).
93
-
94
- * Began logging all `job_errored` events at the `ERROR` log level.
95
-
96
- * Fixed the Railtie when running in test mode (#214).
97
-
98
- * Tweaked the meanings of worker-priorities and worker-count options in the CLI, to better support use cases with low worker counts (#216).
99
-
100
- ---
101
-
102
- ### 1.0.0.beta2 (2018-04-13)
103
-
104
- * **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.
105
-
106
- * 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.
107
-
108
- * 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:
109
-
110
- * 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.
111
-
112
- * 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.
113
-
114
- * Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
115
-
116
- * PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
117
-
118
- * Other features introduced in this version include:
119
-
120
- * Much better support for all versions of ActiveJob.
121
-
122
- * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
123
-
124
- * Custom middleware that wrap running jobs and executing SQL statements are now supported.
125
-
126
- * Support for categorizing jobs with tags.
127
-
128
- * Support for configuring a `maximum_retry_count` on individual job classes.
129
-
130
- * Job configuration options are now inheritable, so job class hierarchies are more useful.
131
-
132
- * There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
133
-
134
- * Jobs that have finished working may optionally be retained in the database indefinitely.
135
-
136
- * 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.
137
-
138
- * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
139
-
140
- * Finished jobs have a timestamp set in the finished_at column.
141
-
142
- * Jobs that have errored too many times will now be marked as expired, and won't be retried again.
143
-
144
- * 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.
145
-
146
- * 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.
147
-
148
- * You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
149
-
150
- * `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
151
-
152
- * `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
153
-
154
- * In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
155
-
156
- * Support for MRI Rubies before 2.2 has been dropped.
157
-
158
- * Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
159
-
160
- * JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
161
-
162
- * The `que:work` rake task has been removed. Use the `que` executable instead.
163
-
164
- * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
165
-
166
- * The `mode` setter has been removed.
167
-
168
- * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
169
-
170
- * 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.
171
-
172
- * The following methods are not meaningful under the new implementation and have been removed:
173
-
174
- * The `Que.wake_interval` getter and setter.
175
-
176
- * The `Que.worker_count` getter and setter.
177
-
178
- * `Que.wake!`
179
-
180
- * `Que.wake_all!`
181
-
182
- * Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
183
-
184
- * It's not clear that anyone ever actually did this.
185
-
186
- * `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`.
187
-
188
- * 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.
189
-
190
- * Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
191
-
192
- * Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
193
-
194
- * It wouldn't have been a good idea to rely on this anyway.
195
-
196
- * Calling Que.log() directly is no longer supported/recommended.
197
-
198
- * Features marked as deprecated in the final 0.x releases have been removed.
199
-
200
- * 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.
201
-
202
- * 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.
203
-
204
- * 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.
205
-
206
- * 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.
207
-
208
- * 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.
209
-
210
- * 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.
211
-
212
- * 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.
213
-
214
- * There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
215
- ---
216
-
217
- ### 1.0.0.beta (2017-10-25)
218
-
219
- * **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.
220
-
221
- * 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.
222
-
223
- * 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:
224
-
225
- * 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.
226
-
227
- * 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.
228
-
229
- * Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
230
-
231
- * PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
232
-
233
- * Other features introduced in this version include:
234
-
235
- * Much better support for all versions of ActiveJob.
236
-
237
- * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
238
-
239
- * Custom middleware that wrap running jobs are now supported.
240
-
241
- * Support for categorizing jobs with tags.
242
-
243
- * Support for configuring a `maximum_retry_count` on individual job classes.
244
-
245
- * Job configuration options are now inheritable, so job class hierarchies are more useful.
246
-
247
- * There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
248
-
249
- * Jobs that have finished working may optionally be retained in the database indefinitely.
250
-
251
- * 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.
252
-
253
- * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
254
-
255
- * Finished jobs have a timestamp set in the finished_at column.
256
-
257
- * Jobs that have errored too many times will now be marked as expired, and won't be retried again.
258
-
259
- * 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.
260
-
261
- * 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.
262
-
263
- * You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
264
-
265
- * `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
266
-
267
- * `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
268
-
269
- * In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
270
-
271
- * Support for MRI Rubies before 2.2 has been dropped.
272
-
273
- * Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
274
-
275
- * JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
276
-
277
- * The `que:work` rake task has been removed. Use the `que` executable instead.
278
-
279
- * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
280
-
281
- * The `mode` setter has been removed.
282
-
283
- * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
284
-
285
- * 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.
159
+ ## 1.0.0.beta4 (2020-01-17)
160
+
161
+ - 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)
162
+ - Cleaner sequel usage, in [#257](https://github.com/que-rb/que/pull/257)
163
+ - 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)
164
+ - The `--minimum-buffer-size` option is now unused
165
+
166
+ ## 1.0.0.beta3 (2018-05-18)
167
+
168
+ - Added support for customizing log levels for `job_worked` events ([#217](https://github.com/que-rb/que/issues/217)).
169
+ - Began logging all `job_errored` events at the `ERROR` log level.
170
+ - Fixed the Railtie when running in test mode ([#214](https://github.com/que-rb/que/issues/214)).
171
+ - 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)).
172
+
173
+ ## 1.0.0.beta2 (2018-04-13)
174
+
175
+ - **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.
176
+ + 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.
177
+ - 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:
178
+ + 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.
179
+ + 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.
180
+ + Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
181
+ + PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
182
+ - Other features introduced in this version include:
183
+ + Much better support for all versions of ActiveJob.
184
+ * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
185
+ + Custom middleware that wrap running jobs and executing SQL statements are now supported.
186
+ + Support for categorizing jobs with tags.
187
+ + Support for configuring a `maximum_retry_count` on individual job classes.
188
+ + Job configuration options are now inheritable, so job class hierarchies are more useful.
189
+ + There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
190
+ + Jobs that have finished working may optionally be retained in the database indefinitely.
191
+ * 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.
192
+ * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
193
+ * Finished jobs have a timestamp set in the finished_at column.
194
+ + Jobs that have errored too many times will now be marked as expired, and won't be retried again.
195
+ * 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.
196
+ * 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.
197
+ + You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
198
+ + `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
199
+ + `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
200
+ - In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
201
+ + Support for MRI Rubies before 2.2 has been dropped.
202
+ + Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
203
+ + JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
204
+ + The `que:work` rake task has been removed. Use the `que` executable instead.
205
+ * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
206
+ + The `mode` setter has been removed.
207
+ * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
208
+ * 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.
209
+ + The following methods are not meaningful under the new implementation and have been removed:
210
+ * The `Que.wake_interval` getter and setter.
211
+ * The `Que.worker_count` getter and setter.
212
+ * `Que.wake!`
213
+ * `Que.wake_all!`
214
+ + Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
215
+ * It's not clear that anyone ever actually did this.
216
+ + `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`.
217
+ + 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.
218
+ + Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
219
+ + Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
220
+ * It wouldn't have been a good idea to rely on this anyway.
221
+ + Calling Que.log() directly is no longer supported/recommended.
222
+ + Features marked as deprecated in the final 0.x releases have been removed.
223
+ - 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.
224
+ + 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.
225
+ + 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.
226
+ + 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.
227
+ + 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.
228
+ + 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.
229
+ + 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.
230
+ + There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
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
+ + 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.
236
+ - 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:
237
+ + 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.
238
+ + 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.
239
+ + Individual workers no longer need to monopolize their own (usually idle) connections while working jobs, so Ruby processes will require fewer Postgres connections.
240
+ + PgBouncer or another external connection pool can be used for workers' connections (though not for the connection used to lock and listen for jobs).
241
+ - Other features introduced in this version include:
242
+ + Much better support for all versions of ActiveJob.
243
+ * In particular, you may (optionally) include `Que::ActiveJob::JobExtensions` into `ApplicationJob` to get support for all of Que's job helper methods.
244
+ + Custom middleware that wrap running jobs are now supported.
245
+ + Support for categorizing jobs with tags.
246
+ + Support for configuring a `maximum_retry_count` on individual job classes.
247
+ + Job configuration options are now inheritable, so job class hierarchies are more useful.
248
+ + There are now built-in models for ActiveRecord and Sequel to allow inspecting the queue easily.
249
+ + Jobs that have finished working may optionally be retained in the database indefinitely.
250
+ * 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.
251
+ * If you don't resolve a job yourself one way or another, Que will still `destroy` the job for you by default.
252
+ * Finished jobs have a timestamp set in the finished_at column.
253
+ + Jobs that have errored too many times will now be marked as expired, and won't be retried again.
254
+ * 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.
255
+ * 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.
256
+ + You can now set job priority thresholds for individual workers, to ensure that there will always be space available for high-priority jobs.
257
+ + `Que.job_states` returns a list of locked jobs and the hostname/pid of the Ruby processes that have locked them.
258
+ + `Que.connection_proc=` has been added, to allow for the easy integration of custom connection pools.
259
+ - In keeping with semantic versioning, the major version is being bumped since the new implementation requires some backwards-incompatible changes. These changes include:
260
+ + Support for MRI Rubies before 2.2 has been dropped.
261
+ + Support for Postgres versions before 9.5 has been dropped (JSONB and upsert support is required).
262
+ + JRuby support has been dropped. It will be reintroduced whenever the jruby-pg gem is production-ready.
263
+ + The `que:work` rake task has been removed. Use the `que` executable instead.
264
+ * Therefore, configuring workers using QUE_* environment variables is no longer supported. Please pass the appropriate options to the `que` executable instead.
265
+ + The `mode` setter has been removed.
266
+ * To run jobs synchronously when they are enqueued (the old `:sync` behavior) you can set `Que.run_synchronously = true`.
267
+ * 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.
268
+ + The following methods are not meaningful under the new implementation and have been removed:
269
+ * The `Que.wake_interval` getter and setter.
270
+ * The `Que.worker_count` getter and setter.
271
+ * `Que.wake!`
272
+ * `Que.wake_all!`
273
+ + Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
274
+ * It's not clear that anyone ever actually did this.
275
+ + `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`.
276
+ + 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.
277
+ + Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
278
+ + Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
279
+ * It wouldn't have been a good idea to rely on this anyway.
280
+ + Calling Que.log() directly is no longer supported/recommended.
281
+ + Features marked as deprecated in the final 0.x releases have been removed.
282
+ - 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.
283
+ + 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.
284
+ + 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.
285
+ + 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.
286
+ + 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.
287
+ + 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.
288
+ + 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.
289
+ + There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
290
+
291
+ ## 0.14.3 (2018-03-02)
292
+
293
+ - Recorded errors now always include the error class, so that empty error messages can still be helpful. ( joehorsnell)
294
+ - Recorded error messages are now truncated to the first 500 characters.
295
+
296
+ ## 0.14.2 (2018-01-05)
297
+
298
+ - Deprecate the Que.disable_prepared_statements= accessors.
299
+ - Add Que.use_prepared_statements= configuration accessors.
300
+ - Update the generated Rails migration to declare a version. (NARKOZ)
286
301
 
287
- * The following methods are not meaningful under the new implementation and have been removed:
302
+ ## 0.14.1 (2017-12-14)
288
303
 
289
- * The `Que.wake_interval` getter and setter.
304
+ - Fix a bug with typecasting boolean values on Rails 5+.
290
305
 
291
- * The `Que.worker_count` getter and setter.
306
+ ## 0.14.0 (2017-08-11)
292
307
 
293
- * `Que.wake!`
308
+ - Fix incompatibility with Rails 5.1.
309
+ - Drop support for waking an in-process worker when an ActiveRecord transaction commits.
294
310
 
295
- * `Que.wake_all!`
311
+ ## 0.13.1 (2017-07-05)
296
312
 
297
- * Since Que needs a dedicated Postgres connection to manage job locks, running Que through a single PG connection is no longer supported.
313
+ - Fix issue that caused error stacktraces to not be persisted in most cases.
298
314
 
299
- * It's not clear that anyone ever actually did this.
315
+ ## 0.13.0 (2017-06-08)
300
316
 
301
- * `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`.
317
+ - 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.
302
318
 
303
- * 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.
319
+ ## 0.12.3 (2017-06-01)
304
320
 
305
- * Arguments passed to jobs are now deep-frozen, to prevent unexpected behavior when the args are mutated and the job is reenqueued.
321
+ - Fix incompatibility with MultiJson introduced by the previous release.
306
322
 
307
- * Since JSONB is now used to store arguments, the order of argument hashes is no longer maintained.
323
+ ## 0.12.2 (2017-06-01)
308
324
 
309
- * It wouldn't have been a good idea to rely on this anyway.
325
+ - 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)
310
326
 
311
- * Calling Que.log() directly is no longer supported/recommended.
327
+ ## 0.12.1 (2017-01-22)
312
328
 
313
- * Features marked as deprecated in the final 0.x releases have been removed.
329
+ - Fix incompatibility with Rails 5.0. ([#166](https://github.com/que-rb/que/issues/166)) (nbibler, thedarkone)
314
330
 
315
- * 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.
331
+ ## 0.12.0 (2016-09-09)
316
332
 
317
- * 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.
333
+ - 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.
334
+ - 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))
318
335
 
319
- * 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.
336
+ ## 0.11.6 (2016-07-01)
320
337
 
321
- * 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.
338
+ - Fix for operating in nested transactions in Rails 5.0. ([#160](https://github.com/que-rb/que/pull/160)) (greysteil)
322
339
 
323
- * 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.
340
+ ## 0.11.5 (2016-05-13)
324
341
 
325
- * 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.
342
+ - Fix error when running `que -v`. ([#154](https://github.com/que-rb/que/pull/154)) (hardbap)
326
343
 
327
- * 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.
344
+ ## 0.11.4 (2016-03-03)
328
345
 
329
- * There is now a `data` JSONB column which is used to support various ways of organizing jobs (setting tags on them, etc).
346
+ - 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)
330
347
 
331
- ---
348
+ ## 0.11.3 (2016-02-26)
332
349
 
333
- ### 0.14.3 (2018-03-02)
350
+ - Fixed bug with displaying the current version of the que executable. ([#122](https://github.com/que-rb/que/pull/122)) (hardbap)
351
+ - 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)
352
+ - Officially added support for Ruby 2.2 and 2.3.
353
+ - String literals are now frozen on Ruby 2.3.
334
354
 
335
- * Recorded errors now always include the error class, so that empty error messages can still be helpful. ( joehorsnell)
355
+ ## 0.11.2 (2015-09-09)
336
356
 
337
- * Recorded error messages are now truncated to the first 500 characters.
357
+ - Fix Job class constantizing when ActiveSupport isn't loaded. ([#121](https://github.com/que-rb/que/pull/121)) (godfat)
338
358
 
339
- ---
359
+ ## 0.11.1 (2015-09-04)
340
360
 
341
- ### 0.14.2 (2018-01-05)
361
+ - 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.
342
362
 
343
- * Deprecate the Que.disable_prepared_statements= accessors.
363
+ ## 0.11.0 (2015-09-04)
344
364
 
345
- * Add Que.use_prepared_statements= configuration accessors.
365
+ - 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.
366
+ - 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).
367
+ - 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))
368
+ - 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))
369
+ - 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))
370
+ - 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)
346
371
 
347
- * Update the generated Rails migration to declare a version. (NARKOZ)
372
+ ## 0.10.0 (2015-03-18)
348
373
 
349
- ---
374
+ - 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)
375
+ - 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))
376
+ - 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))
350
377
 
351
- ### 0.14.1 (2017-12-14)
378
+ ## 0.9.2 (2015-02-05)
352
379
 
353
- * Fix a bug with typecasting boolean values on Rails 5+.
380
+ - Fix a bug wherein the at_exit hook in the railtie wasn't waiting for jobs to finish before exiting.
381
+ - 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)
354
382
 
355
- ---
383
+ ## 0.9.1 (2015-01-11)
356
384
 
357
- ### 0.14.0 (2017-08-11)
385
+ - 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)
358
386
 
359
- * Fix incompatibility with Rails 5.1.
387
+ ## 0.9.0 (2014-12-16)
360
388
 
361
- * Drop support for waking an in-process worker when an ActiveRecord transaction commits.
389
+ - 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)
362
390
 
363
- ---
391
+ ## 0.8.2 (2014-10-12)
364
392
 
365
- ### 0.13.1 (2017-07-05)
393
+ - 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)
366
394
 
367
- * Fix issue that caused error stacktraces to not be persisted in most cases.
395
+ ## 0.8.1 (2014-07-28)
368
396
 
369
- ---
397
+ - 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))
370
398
 
371
- ### 0.13.0 (2017-06-08)
399
+ ## 0.8.0 (2014-07-12)
372
400
 
373
- * 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.
401
+ - 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.
402
+ - `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))
403
+ - Fixed a similar bug wherein setting a wake_interval during application startup would break worker awakening after the process was forked.
374
404
 
375
- ---
405
+ ## 0.7.3 (2014-05-19)
376
406
 
377
- ### 0.12.3 (2017-06-01)
407
+ - 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)).
378
408
 
379
- * Fix incompatibility with MultiJson introduced by the previous release.
409
+ ## 0.7.2 (2014-05-18)
380
410
 
381
- ### 0.12.2 (2017-06-01)
411
+ - Fix issue wherein intermittent worker wakeups would not work after forking ([#44](https://github.com/que-rb/que/issues/44)).
382
412
 
383
- * 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)
413
+ ## 0.7.1 (2014-04-29)
384
414
 
385
- ---
415
+ - Fix errors with prepared statements when ActiveRecord reconnects to the database. (dvrensk)
416
+ - 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.
386
417
 
387
- ### 0.12.1 (2017-01-22)
418
+ ## 0.7.0 (2014-04-09)
388
419
 
389
- * Fix incompatibility with Rails 5.0. (#166) (nbibler, thedarkone)
420
+ - `JobClass.queue(*args)` has been deprecated and will be removed in version 1.0.0. Please use `JobClass.enqueue(*args)` instead.
421
+ - 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.
422
+ - Log lines now include the process pid - its omission in the previous release was an oversight.
423
+ - 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.
390
424
 
391
- ---
425
+ ## 0.6.0 (2014-02-04)
392
426
 
393
- ### 0.12.0 (2016-09-09)
427
+ - **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.
428
+ - 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.
429
+ - You can now check the current version of Que's database schema with `Que.db_version`.
430
+ - 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.
431
+ - 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.
432
+ - Log lines now include the machine's hostname, since a pid alone may not uniquely identify a process.
433
+ - Multiple queues are now supported. See [the docs](https://github.com/que-rb/que/blob/master/docs/multiple_queues.md) for details. (chanks, joevandyk)
434
+ - Rubinius 2.2 is now supported. (brixen)
435
+ - 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.
394
436
 
395
- * 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.
437
+ ## 0.5.0 (2014-01-14)
396
438
 
397
- * Introduced a new framework for handling errors on a per-job basis. See the docs for more information. (#106, #147)
398
-
399
- ---
400
-
401
- ### 0.11.6 (2016-07-01)
402
-
403
- * Fix for operating in nested transactions in Rails 5.0. (#160) (greysteil)
404
-
405
- ---
406
-
407
- ### 0.11.5 (2016-05-13)
408
-
409
- * Fix error when running `que -v`. (#154) (hardbap)
410
-
411
- ---
412
-
413
- ### 0.11.4 (2016-03-03)
414
-
415
- * Fix incompatibility with ActiveRecord 5.0.0.beta3. (#143, #144) (joevandyk)
416
-
417
- ---
418
-
419
- ### 0.11.3 (2016-02-26)
420
-
421
- * Fixed bug with displaying the current version of the que executable. (#122) (hardbap)
422
-
423
- * Output to STDOUT when running via the executable or rake task is no longer buffered. This prevented logging in some cases. (#129) (hmarr)
424
-
425
- * Officially added support for Ruby 2.2 and 2.3.
426
-
427
- * String literals are now frozen on Ruby 2.3.
428
-
429
- ---
430
-
431
- ### 0.11.2 (2015-09-09)
432
-
433
- * Fix Job class constantizing when ActiveSupport isn't loaded. (#121) (godfat)
434
-
435
- ---
436
-
437
- ### 0.11.1 (2015-09-04)
438
-
439
- * 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.
440
-
441
- ---
442
-
443
- ### 0.11.0 (2015-09-04)
444
-
445
- * 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.
446
-
447
- * 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).
448
-
449
- * Add a Que.disable_prepared_transactions= configuration option, to make it easier to use tools like pgbouncer. (#110)
450
-
451
- * 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)
452
-
453
- * 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)
454
-
455
- * If it exists, use String#constantize to constantize job classes, since ActiveSupport's constantize method behaves better with Rails' autoloading. (#115, #120) (joevandyk)
456
-
457
- ---
458
-
459
- ### 0.10.0 (2015-03-18)
460
-
461
- * When working jobs via the rake task, Rails applications are now eager-loaded if present, to avoid problems with multithreading and autoloading. (#96) (hmarr)
462
-
463
- * The que:work rake task now uses whatever logger Que is configured to use normally, rather than forcing the use of STDOUT. (#95)
464
-
465
- * Add Que.transaction() helper method, to aid in transaction management in migrations or when the user's ORM doesn't provide one. (#81)
466
-
467
- ---
468
-
469
- ### 0.9.2 (2015-02-05)
470
-
471
- * Fix a bug wherein the at_exit hook in the railtie wasn't waiting for jobs to finish before exiting.
472
-
473
- * Fix a bug wherein the que:work rake task wasn't waiting for jobs to finish before exiting. (#85) (tycooon)
474
-
475
- ---
476
-
477
- ### 0.9.1 (2015-01-11)
478
-
479
- * Use now() rather than 'now' when inserting jobs, to avoid using an old value as the default run_at in prepared statements. (#74) (bgentry)
480
-
481
- ---
482
-
483
- ### 0.9.0 (2014-12-16)
484
-
485
- * 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)
486
-
487
- ---
488
-
489
- ### 0.8.2 (2014-10-12)
490
-
491
- * Fix errors raised during rollbacks in the ActiveRecord adapter, which remained silent until Rails 4.2. (#64, #65) (Strech)
492
-
493
- ---
494
-
495
- ### 0.8.1 (2014-07-28)
496
-
497
- * Fix regression introduced in the `que:work` rake task by the `mode` / `worker_count` disentangling in 0.8.0. (#50)
498
-
499
- ---
500
-
501
- ### 0.8.0 (2014-07-12)
502
-
503
- * 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.
504
-
505
- * `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)
506
-
507
- * Fixed a similar bug wherein setting a wake_interval during application startup would break worker awakening after the process was forked.
508
-
509
- ---
510
-
511
- ### 0.7.3 (2014-05-19)
512
-
513
- * When mode = :sync, don't touch the database at all when running jobs inline. Needed for ActiveJob compatibility (#46).
514
-
515
- ---
516
-
517
- ### 0.7.2 (2014-05-18)
518
-
519
- * Fix issue wherein intermittent worker wakeups would not work after forking (#44).
520
-
521
- ---
522
-
523
- ### 0.7.1 (2014-04-29)
524
-
525
- * Fix errors with prepared statements when ActiveRecord reconnects to the database. (dvrensk)
526
-
527
- * 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.
528
-
529
- ---
530
-
531
- ### 0.7.0 (2014-04-09)
532
-
533
- * `JobClass.queue(*args)` has been deprecated and will be removed in version 1.0.0. Please use `JobClass.enqueue(*args)` instead.
534
-
535
- * 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.
536
-
537
- * Log lines now include the process pid - its omission in the previous release was an oversight.
538
-
539
- * 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.
540
-
541
- ---
542
-
543
- ### 0.6.0 (2014-02-04)
544
-
545
- * **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.
546
-
547
- * 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.
548
-
549
- * You can now check the current version of Que's database schema with `Que.db_version`.
550
-
551
- * 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.
552
-
553
- * 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.
554
-
555
- * Log lines now include the machine's hostname, since a pid alone may not uniquely identify a process.
556
-
557
- * Multiple queues are now supported. See [the docs](https://github.com/que-rb/que/blob/master/docs/multiple_queues.md) for details. (chanks, joevandyk)
558
-
559
- * Rubinius 2.2 is now supported. (brixen)
560
-
561
- * 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.
562
-
563
- ---
564
-
565
- ### 0.5.0 (2014-01-14)
566
-
567
- * 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)
568
-
569
- * 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.
570
-
571
- * 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.
572
-
573
- * 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.
574
-
575
- * 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.
576
-
577
- * 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.
578
-
579
- * MultiJson is now a soft dependency. Que will use it if it is available, but it is not required.
580
-
581
- * Remove Que.stop!.
439
+ - 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)
440
+ - 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.
441
+ - 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.
442
+ - 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.
443
+ - 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.
444
+ - 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.
445
+ - MultiJson is now a soft dependency. Que will use it if it is available, but it is not required.
446
+ - Remove Que.stop!.
582
447
 
583
448
  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).
584
449
 
585
450
  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.
586
451
 
587
- ---
588
-
589
- ### 0.4.0 (2014-01-05)
590
-
591
- * Que.wake_all! was added, as a simple way to wake up all workers in the pool.
592
-
593
- * Que.sleep_period was renamed to the more descriptive Que.wake_interval.
452
+ ## 0.4.0 (2014-01-05)
594
453
 
595
- * 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.
454
+ - Que.wake_all! was added, as a simple way to wake up all workers in the pool.
455
+ - Que.sleep_period was renamed to the more descriptive Que.wake_interval.
456
+ - 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.
596
457
 
597
458
  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.
459
+ - 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.
460
+ - 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.
461
+ - 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.
462
+ - Add Que.worker_count, to retrieve the current number of workers in the pool of the current process.
463
+ - Much more internal cleanup.
598
464
 
599
- * 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.
600
-
601
- * 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.
602
-
603
- * 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.
604
-
605
- * Add Que.worker_count, to retrieve the current number of workers in the pool of the current process.
465
+ ## 0.3.0 (2013-12-21)
606
466
 
607
- * Much more internal cleanup.
608
-
609
- ---
610
-
611
- ### 0.3.0 (2013-12-21)
612
-
613
- * Add Que.stop!, which immediately kills all jobs being worked in the process.
467
+ - Add Que.stop!, which immediately kills all jobs being worked in the process.
614
468
 
615
469
  This can leave database connections and such in an unpredictable state, and so should only be used when the process is exiting.
616
-
617
- * Use Que.stop! to safely handle processes that exit while Que is running.
470
+ - Use Que.stop! to safely handle processes that exit while Que is running.
618
471
 
619
472
  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.
473
+ - Clean up internals and hammer out several race conditions.
620
474
 
621
- * Clean up internals and hammer out several race conditions.
475
+ ## 0.2.0 (2013-11-30)
622
476
 
623
- ---
624
-
625
- ### 0.2.0 (2013-11-30)
626
-
627
- * Officially support JRuby 1.7.5+. Earlier versions may work.
477
+ - Officially support JRuby 1.7.5+. Earlier versions may work.
628
478
 
629
479
  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.
480
+ - Officially support Rubinius 2.1.1+. Earlier versions may work.
481
+ - Use `multi_json` so we always use the fastest JSON parser available. (BukhariH)
482
+ - :sync mode now ignores scheduled jobs (jobs queued with a specific run_at).
630
483
 
631
- * Officially support Rubinius 2.1.1+. Earlier versions may work.
632
-
633
- * Use `multi_json` so we always use the fastest JSON parser available. (BukhariH)
634
-
635
- * :sync mode now ignores scheduled jobs (jobs queued with a specific run_at).
636
-
637
- ---
638
-
639
- ### 0.1.0 (2013-11-18)
640
-
641
- * Initial public release, after a test-driven rewrite.
642
-
643
- Officially support Ruby 2.0.0 and Postgres 9.2+.
644
-
645
- Also support ActiveRecord and bare PG::Connections, in or out of a ConnectionPool.
646
-
647
- Added a Railtie for easier setup with Rails, as well as a migration generator.
484
+ ## 0.1.0 (2013-11-18)
648
485
 
649
- ---
486
+ - Initial public release, after a test-driven rewrite.
487
+ - Officially support Ruby 2.0.0 and Postgres 9.2+.
488
+ - Also support ActiveRecord and bare PG::Connections, in or out of a ConnectionPool.
489
+ - Added a Railtie for easier setup with Rails, as well as a migration generator.
650
490
 
651
- ### 0.0.1 (2013-11-07)
491
+ ## 0.0.1 (2013-11-07)
652
492
 
653
- * Copy-pasted from an app of mine. Very Sequel-specific. Nobody look at it, let's pretend it never happened.
493
+ - Copy-pasted from an app of mine. Very Sequel-specific. Nobody look at it, let's pretend it never happened.