que 1.0.0.beta4 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/{ruby.yml → tests.yml} +8 -4
- data/CHANGELOG.md +409 -293
- data/Dockerfile +20 -0
- data/README.md +129 -28
- data/auto/dev +21 -0
- data/auto/pre-push-hook +30 -0
- data/auto/psql +9 -0
- data/auto/test +5 -0
- data/auto/test-postgres-14 +17 -0
- data/bin/command_line_interface.rb +14 -6
- data/docker-compose.yml +46 -0
- data/docs/README.md +17 -18
- data/lib/que/active_record/model.rb +1 -1
- data/lib/que/connection.rb +4 -0
- data/lib/que/job.rb +35 -17
- data/lib/que/job_buffer.rb +28 -28
- data/lib/que/locker.rb +24 -12
- data/lib/que/migrations/4/up.sql +3 -1
- data/lib/que/migrations/5/down.sql +73 -0
- data/lib/que/migrations/5/up.sql +76 -0
- data/lib/que/migrations.rb +1 -2
- data/lib/que/poller.rb +10 -3
- data/lib/que/version.rb +5 -1
- data/lib/que/worker.rb +12 -4
- data/lib/que.rb +2 -1
- data/scripts/docker-entrypoint +14 -0
- data/scripts/test +5 -0
- metadata +20 -10
- data/CHANGELOG.1.0.beta.md +0 -137
data/CHANGELOG.md
CHANGED
@@ -1,371 +1,487 @@
|
|
1
|
-
|
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)
|
66
|
+
|
67
|
+
Unfortunately, v1.3.0 was broken. Follow its upgrade instructions, but use this version instead.
|
68
|
+
|
69
|
+
- **Fixed**
|
70
|
+
+ Fixed startup error: `undefined method 'job_schema_version' for Que:Module`, in [#343](https://github.com/que-rb/que/pull/343)
|
71
|
+
|
72
|
+
## 1.3.0 (2022-02-25)
|
73
|
+
|
74
|
+
**ACTION REQUIRED**
|
75
|
+
|
76
|
+
This release will allow you to safely upgrade to Que 2 when it comes out, without first needing to empty your `que_jobs` table.
|
77
|
+
|
78
|
+
**You will need to first update to this version, apply the Que schema migration, and deploy, before you can safely begin the process of upgrading to Que 2.**
|
79
|
+
|
80
|
+
Que 2 will bring Ruby 3 support, but to do that, the job arguments in the `que_jobs` table will need to be split into two columns - repurposing the existing one for positional arguments only (`args`), and adding a new one for keyword arguments (`kwargs`). This is so that Que running in Ruby 3, when reading job arguments stored in the database, can disambiguate between keyword arguments and a last positional argument hash.
|
81
|
+
|
82
|
+
The args split hasn't happened yet, but when it does, we still need to be able to successfully process all the existing queued jobs which have their keyword arguments in the `args` column still. Our solution is for you to have both Que 1 workers and Que 2 workers operating simultaneously during the upgrade, each processing only the jobs enqueued from that version. Once all the Que 1 jobs are processed, the Que 1 workers can be retired.
|
83
|
+
|
84
|
+
To allow the different worker versions to tell which jobs belong to which, we've added a new column to the `que_jobs` table in this version, `job_schema_version`. Jobs enqueued with Que 1 will have a `1` here, and jobs from Que 2 will have a `2`. Que schema migration 5 will default the job schema version of all existing jobs to `1`.
|
85
|
+
|
86
|
+
You will need to migrate Que to the latest Que schema version (5). For instance, on ActiveRecord and Rails 6:
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
class UpdateQueTablesToVersion5 < ActiveRecord::Migration[6.0]
|
90
|
+
def up
|
91
|
+
Que.migrate!(version: 5)
|
92
|
+
end
|
93
|
+
def down
|
94
|
+
Que.migrate!(version: 4)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
99
|
+
You must apply the schema migration and deploy to upgrade all workers.
|
100
|
+
|
101
|
+
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.
|
102
|
+
|
103
|
+
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`.
|
104
|
+
|
105
|
+
**Other improvements**:
|
106
|
+
|
107
|
+
- **Features**:
|
108
|
+
+ Log config on startup, in [#337](https://github.com/que-rb/que/pull/337)
|
109
|
+
- **Internal**:
|
110
|
+
+ Added Git pre-push hook, in [#338](https://github.com/que-rb/que/pull/338)
|
111
|
+
+ Documented our gem release process, in [#341](https://github.com/que-rb/que/pull/341)
|
112
|
+
|
113
|
+
## 1.2.0 (2022-02-23)
|
114
|
+
|
115
|
+
- **Deprecated**
|
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)
|
117
|
+
|
118
|
+
## 1.1.0 (2022-02-21)
|
119
|
+
|
120
|
+
- **Features**:
|
121
|
+
+ Add backtrace to errors, by [@trammel](https://github.com/trammel) in [#328](https://github.com/que-rb/que/pull/328)
|
122
|
+
- **Internal**:
|
123
|
+
+ Add Dockerised development environment, in [#324](https://github.com/que-rb/que/pull/324)
|
124
|
+
|
125
|
+
## 1.0.0 (2022-01-24)
|
126
|
+
|
127
|
+
_This release does not add any changes on top of 1.0.0.beta5._
|
128
|
+
|
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)
|
140
|
+
[`5259303`](https://github.com/que-rb/que/commit/52593031a7eef2d52ac38eceb2d8df776ec74090)
|
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)
|
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)
|
151
|
+
**Unless an issue is found we intend for this release to become v1.0.0 proper.**
|
152
|
+
|
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)
|
2
295
|
|
3
|
-
|
296
|
+
## 0.14.1 (2017-12-14)
|
4
297
|
|
5
|
-
|
298
|
+
- Fix a bug with typecasting boolean values on Rails 5+.
|
6
299
|
|
7
|
-
|
300
|
+
## 0.14.0 (2017-08-11)
|
8
301
|
|
9
|
-
|
302
|
+
- Fix incompatibility with Rails 5.1.
|
303
|
+
- Drop support for waking an in-process worker when an ActiveRecord transaction commits.
|
10
304
|
|
11
|
-
|
305
|
+
## 0.13.1 (2017-07-05)
|
12
306
|
|
13
|
-
|
307
|
+
- Fix issue that caused error stacktraces to not be persisted in most cases.
|
14
308
|
|
15
|
-
|
309
|
+
## 0.13.0 (2017-06-08)
|
16
310
|
|
17
|
-
|
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.
|
18
312
|
|
19
|
-
|
313
|
+
## 0.12.3 (2017-06-01)
|
20
314
|
|
21
|
-
|
315
|
+
- Fix incompatibility with MultiJson introduced by the previous release.
|
22
316
|
|
23
|
-
|
317
|
+
## 0.12.2 (2017-06-01)
|
24
318
|
|
25
|
-
|
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)
|
26
320
|
|
27
|
-
|
321
|
+
## 0.12.1 (2017-01-22)
|
28
322
|
|
29
|
-
|
323
|
+
- Fix incompatibility with Rails 5.0. ([#166](https://github.com/que-rb/que/issues/166)) (nbibler, thedarkone)
|
30
324
|
|
31
|
-
|
325
|
+
## 0.12.0 (2016-09-09)
|
32
326
|
|
33
|
-
|
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))
|
34
329
|
|
35
|
-
|
330
|
+
## 0.11.6 (2016-07-01)
|
36
331
|
|
37
|
-
|
332
|
+
- Fix for operating in nested transactions in Rails 5.0. ([#160](https://github.com/que-rb/que/pull/160)) (greysteil)
|
38
333
|
|
39
|
-
|
334
|
+
## 0.11.5 (2016-05-13)
|
40
335
|
|
41
|
-
|
336
|
+
- Fix error when running `que -v`. ([#154](https://github.com/que-rb/que/pull/154)) (hardbap)
|
42
337
|
|
43
|
-
|
338
|
+
## 0.11.4 (2016-03-03)
|
44
339
|
|
45
|
-
|
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)
|
46
341
|
|
47
|
-
|
342
|
+
## 0.11.3 (2016-02-26)
|
48
343
|
|
49
|
-
|
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.
|
50
348
|
|
51
|
-
|
349
|
+
## 0.11.2 (2015-09-09)
|
52
350
|
|
53
|
-
|
351
|
+
- Fix Job class constantizing when ActiveSupport isn't loaded. ([#121](https://github.com/que-rb/que/pull/121)) (godfat)
|
54
352
|
|
55
|
-
|
353
|
+
## 0.11.1 (2015-09-04)
|
56
354
|
|
57
|
-
|
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.
|
58
356
|
|
59
|
-
|
357
|
+
## 0.11.0 (2015-09-04)
|
60
358
|
|
61
|
-
|
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)
|
62
365
|
|
63
|
-
|
366
|
+
## 0.10.0 (2015-03-18)
|
64
367
|
|
65
|
-
|
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))
|
66
371
|
|
67
|
-
|
372
|
+
## 0.9.2 (2015-02-05)
|
68
373
|
|
69
|
-
|
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)
|
70
376
|
|
71
|
-
|
377
|
+
## 0.9.1 (2015-01-11)
|
72
378
|
|
73
|
-
|
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)
|
74
380
|
|
75
|
-
|
381
|
+
## 0.9.0 (2014-12-16)
|
76
382
|
|
77
|
-
|
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)
|
78
384
|
|
79
|
-
|
385
|
+
## 0.8.2 (2014-10-12)
|
80
386
|
|
81
|
-
|
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)
|
82
388
|
|
83
|
-
|
389
|
+
## 0.8.1 (2014-07-28)
|
84
390
|
|
85
|
-
|
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))
|
86
392
|
|
87
|
-
|
393
|
+
## 0.8.0 (2014-07-12)
|
88
394
|
|
89
|
-
|
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.
|
90
398
|
|
91
|
-
|
399
|
+
## 0.7.3 (2014-05-19)
|
92
400
|
|
93
|
-
|
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)).
|
94
402
|
|
95
|
-
|
403
|
+
## 0.7.2 (2014-05-18)
|
96
404
|
|
97
|
-
|
405
|
+
- Fix issue wherein intermittent worker wakeups would not work after forking ([#44](https://github.com/que-rb/que/issues/44)).
|
98
406
|
|
99
|
-
|
407
|
+
## 0.7.1 (2014-04-29)
|
100
408
|
|
101
|
-
|
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.
|
102
411
|
|
103
|
-
|
412
|
+
## 0.7.0 (2014-04-09)
|
104
413
|
|
105
|
-
|
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.
|
106
418
|
|
107
|
-
|
419
|
+
## 0.6.0 (2014-02-04)
|
108
420
|
|
109
|
-
|
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.
|
110
430
|
|
111
|
-
|
431
|
+
## 0.5.0 (2014-01-14)
|
112
432
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
* Recorded error messages are now truncated to the first 500 characters.
|
122
|
-
|
123
|
-
### 0.14.2 (2018-01-05)
|
124
|
-
|
125
|
-
* Deprecate the Que.disable_prepared_statements= accessors.
|
126
|
-
|
127
|
-
* Add Que.use_prepared_statements= configuration accessors.
|
128
|
-
|
129
|
-
* Update the generated Rails migration to declare a version. (NARKOZ)
|
130
|
-
|
131
|
-
### 0.14.1 (2017-12-14)
|
132
|
-
|
133
|
-
* Fix a bug with typecasting boolean values on Rails 5+.
|
134
|
-
|
135
|
-
### 0.14.0 (2017-08-11)
|
136
|
-
|
137
|
-
* Fix incompatibility with Rails 5.1.
|
138
|
-
|
139
|
-
* Drop support for waking an in-process worker when an ActiveRecord transaction commits.
|
140
|
-
|
141
|
-
### 0.13.1 (2017-07-05)
|
142
|
-
|
143
|
-
* Fix issue that caused error stacktraces to not be persisted in most cases.
|
144
|
-
|
145
|
-
### 0.13.0 (2017-06-08)
|
146
|
-
|
147
|
-
* 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.
|
148
|
-
|
149
|
-
### 0.12.3 (2017-06-01)
|
150
|
-
|
151
|
-
* Fix incompatibility with MultiJson introduced by the previous release.
|
152
|
-
|
153
|
-
### 0.12.2 (2017-06-01)
|
154
|
-
|
155
|
-
* 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)
|
156
|
-
|
157
|
-
### 0.12.1 (2017-01-22)
|
158
|
-
|
159
|
-
* Fix incompatibility with Rails 5.0. (#166) (nbibler, thedarkone)
|
160
|
-
|
161
|
-
### 0.12.0 (2016-09-09)
|
162
|
-
|
163
|
-
* 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.
|
164
|
-
|
165
|
-
* Introduced a new framework for handling errors on a per-job basis. See the docs for more information. (#106, #147)
|
166
|
-
|
167
|
-
### 0.11.6 (2016-07-01)
|
168
|
-
|
169
|
-
* Fix for operating in nested transactions in Rails 5.0. (#160) (greysteil)
|
170
|
-
|
171
|
-
### 0.11.5 (2016-05-13)
|
172
|
-
|
173
|
-
* Fix error when running `que -v`. (#154) (hardbap)
|
174
|
-
|
175
|
-
### 0.11.4 (2016-03-03)
|
176
|
-
|
177
|
-
* Fix incompatibility with ActiveRecord 5.0.0.beta3. (#143, #144) (joevandyk)
|
178
|
-
|
179
|
-
### 0.11.3 (2016-02-26)
|
180
|
-
|
181
|
-
* Fixed bug with displaying the current version of the que executable. (#122) (hardbap)
|
182
|
-
|
183
|
-
* Output to STDOUT when running via the executable or rake task is no longer buffered. This prevented logging in some cases. (#129) (hmarr)
|
184
|
-
|
185
|
-
* Officially added support for Ruby 2.2 and 2.3.
|
186
|
-
|
187
|
-
* String literals are now frozen on Ruby 2.3.
|
188
|
-
|
189
|
-
### 0.11.2 (2015-09-09)
|
190
|
-
|
191
|
-
* Fix Job class constantizing when ActiveSupport isn't loaded. (#121) (godfat)
|
192
|
-
|
193
|
-
### 0.11.1 (2015-09-04)
|
194
|
-
|
195
|
-
* 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.
|
196
|
-
|
197
|
-
### 0.11.0 (2015-09-04)
|
198
|
-
|
199
|
-
* 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.
|
200
|
-
|
201
|
-
* 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).
|
202
|
-
|
203
|
-
* Add a Que.disable_prepared_transactions= configuration option, to make it easier to use tools like pgbouncer. (#110)
|
204
|
-
|
205
|
-
* 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)
|
206
|
-
|
207
|
-
* 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)
|
208
|
-
|
209
|
-
* If it exists, use String#constantize to constantize job classes, since ActiveSupport's constantize method behaves better with Rails' autoloading. (#115, #120) (joevandyk)
|
210
|
-
|
211
|
-
### 0.10.0 (2015-03-18)
|
212
|
-
|
213
|
-
* When working jobs via the rake task, Rails applications are now eager-loaded if present, to avoid problems with multithreading and autoloading. (#96) (hmarr)
|
214
|
-
|
215
|
-
* The que:work rake task now uses whatever logger Que is configured to use normally, rather than forcing the use of STDOUT. (#95)
|
216
|
-
|
217
|
-
* Add Que.transaction() helper method, to aid in transaction management in migrations or when the user's ORM doesn't provide one. (#81)
|
218
|
-
|
219
|
-
### 0.9.2 (2015-02-05)
|
220
|
-
|
221
|
-
* Fix a bug wherein the at_exit hook in the railtie wasn't waiting for jobs to finish before exiting.
|
222
|
-
|
223
|
-
* Fix a bug wherein the que:work rake task wasn't waiting for jobs to finish before exiting. (#85) (tycooon)
|
224
|
-
|
225
|
-
### 0.9.1 (2015-01-11)
|
226
|
-
|
227
|
-
* Use now() rather than 'now' when inserting jobs, to avoid using an old value as the default run_at in prepared statements. (#74) (bgentry)
|
228
|
-
|
229
|
-
### 0.9.0 (2014-12-16)
|
230
|
-
|
231
|
-
* 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)
|
232
|
-
|
233
|
-
### 0.8.2 (2014-10-12)
|
234
|
-
|
235
|
-
* Fix errors raised during rollbacks in the ActiveRecord adapter, which remained silent until Rails 4.2. (#64, #65) (Strech)
|
236
|
-
|
237
|
-
### 0.8.1 (2014-07-28)
|
238
|
-
|
239
|
-
* Fix regression introduced in the `que:work` rake task by the `mode` / `worker_count` disentangling in 0.8.0. (#50)
|
240
|
-
|
241
|
-
### 0.8.0 (2014-07-12)
|
242
|
-
|
243
|
-
* 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.
|
244
|
-
|
245
|
-
* `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)
|
246
|
-
|
247
|
-
* Fixed a similar bug wherein setting a wake_interval during application startup would break worker awakening after the process was forked.
|
248
|
-
|
249
|
-
### 0.7.3 (2014-05-19)
|
250
|
-
|
251
|
-
* When mode = :sync, don't touch the database at all when running jobs inline. Needed for ActiveJob compatibility (#46).
|
252
|
-
|
253
|
-
### 0.7.2 (2014-05-18)
|
254
|
-
|
255
|
-
* Fix issue wherein intermittent worker wakeups would not work after forking (#44).
|
256
|
-
|
257
|
-
### 0.7.1 (2014-04-29)
|
258
|
-
|
259
|
-
* Fix errors with prepared statements when ActiveRecord reconnects to the database. (dvrensk)
|
260
|
-
|
261
|
-
* 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.
|
262
|
-
|
263
|
-
### 0.7.0 (2014-04-09)
|
264
|
-
|
265
|
-
* `JobClass.queue(*args)` has been deprecated and will be removed in version 1.0.0. Please use `JobClass.enqueue(*args)` instead.
|
266
|
-
|
267
|
-
* 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.
|
268
|
-
|
269
|
-
* Log lines now include the process pid - its omission in the previous release was an oversight.
|
270
|
-
|
271
|
-
* 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.
|
272
|
-
|
273
|
-
### 0.6.0 (2014-02-04)
|
274
|
-
|
275
|
-
* **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.
|
276
|
-
|
277
|
-
* 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.
|
278
|
-
|
279
|
-
* You can now check the current version of Que's database schema with `Que.db_version`.
|
280
|
-
|
281
|
-
* 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.
|
282
|
-
|
283
|
-
* 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.
|
284
|
-
|
285
|
-
* Log lines now include the machine's hostname, since a pid alone may not uniquely identify a process.
|
286
|
-
|
287
|
-
* Multiple queues are now supported. See [the docs](https://github.com/que-rb/que/blob/master/docs/multiple_queues.md) for details. (chanks, joevandyk)
|
288
|
-
|
289
|
-
* Rubinius 2.2 is now supported. (brixen)
|
290
|
-
|
291
|
-
* 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.
|
292
|
-
|
293
|
-
### 0.5.0 (2014-01-14)
|
294
|
-
|
295
|
-
* 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)
|
296
|
-
|
297
|
-
* 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.
|
298
|
-
|
299
|
-
* 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.
|
300
|
-
|
301
|
-
* 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.
|
302
|
-
|
303
|
-
* 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.
|
304
|
-
|
305
|
-
* 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.
|
306
|
-
|
307
|
-
* MultiJson is now a soft dependency. Que will use it if it is available, but it is not required.
|
308
|
-
|
309
|
-
* 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!.
|
310
441
|
|
311
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).
|
312
443
|
|
313
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.
|
314
445
|
|
315
|
-
|
316
|
-
|
317
|
-
* Que.wake_all! was added, as a simple way to wake up all workers in the pool.
|
446
|
+
## 0.4.0 (2014-01-05)
|
318
447
|
|
319
|
-
|
320
|
-
|
321
|
-
|
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.
|
322
451
|
|
323
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.
|
324
458
|
|
325
|
-
|
326
|
-
|
327
|
-
* 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.
|
328
|
-
|
329
|
-
* 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.
|
330
|
-
|
331
|
-
* Add Que.worker_count, to retrieve the current number of workers in the pool of the current process.
|
459
|
+
## 0.3.0 (2013-12-21)
|
332
460
|
|
333
|
-
|
334
|
-
|
335
|
-
### 0.3.0 (2013-12-21)
|
336
|
-
|
337
|
-
* 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.
|
338
462
|
|
339
463
|
This can leave database connections and such in an unpredictable state, and so should only be used when the process is exiting.
|
340
|
-
|
341
|
-
* 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.
|
342
465
|
|
343
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.
|
344
468
|
|
345
|
-
|
469
|
+
## 0.2.0 (2013-11-30)
|
346
470
|
|
347
|
-
|
348
|
-
|
349
|
-
* Officially support JRuby 1.7.5+. Earlier versions may work.
|
471
|
+
- Officially support JRuby 1.7.5+. Earlier versions may work.
|
350
472
|
|
351
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).
|
352
477
|
|
353
|
-
|
354
|
-
|
355
|
-
* Use `multi_json` so we always use the fastest JSON parser available. (BukhariH)
|
356
|
-
|
357
|
-
* :sync mode now ignores scheduled jobs (jobs queued with a specific run_at).
|
358
|
-
|
359
|
-
### 0.1.0 (2013-11-18)
|
360
|
-
|
361
|
-
* Initial public release, after a test-driven rewrite.
|
362
|
-
|
363
|
-
Officially support Ruby 2.0.0 and Postgres 9.2+.
|
364
|
-
|
365
|
-
Also support ActiveRecord and bare PG::Connections, in or out of a ConnectionPool.
|
478
|
+
## 0.1.0 (2013-11-18)
|
366
479
|
|
367
|
-
|
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.
|
368
484
|
|
369
|
-
|
485
|
+
## 0.0.1 (2013-11-07)
|
370
486
|
|
371
|
-
|
487
|
+
- Copy-pasted from an app of mine. Very Sequel-specific. Nobody look at it, let's pretend it never happened.
|