Changelog History
Page 1
-
v2.2.0 Changes
August 29, 2022- ๐ Changed:
- When migrating, now raises an exception when the Que DB schema version is missing from the database. The migrations system records this version in a comment on the
que_jobs
table. #379- > Que::Error: Cannot determine Que DB schema version. > > The que_jobs table is missing its comment recording the Que DB schema version. This is likely due to a bug in Rails schema dump in Rails 7 versions prior to 7.0.3, omitting comments - see https://github.com/que-rb/que/issues/363. Please determine the appropriate schema version from your migrations and record it manually by running the following SQL (replacing version as appropriate): > > COMMENT ON TABLE que_jobs IS 'version';
- When migrating, now raises an exception when the Que DB schema version is missing from the database. The migrations system records this version in a comment on the
- โ Removed:
- Removed support for upgrading directly from a version of Que prior to v0.5.0 (released on 2014-01-14), which introduced the migrations system. It's too difficult to handle the different DB schemas from prior to this.
- Internal:
- Moved
command_line_interface.rb
frombin/
tolib/
. #378
- Moved
- ๐ Changed:
-
v2.1.0 Changes
August 25, 2022- โ Added:
- Added bulk enqueue interface for performance when enqueuing a large number of jobs at once - [docs](docs#enqueueing-jobs-in-bulk).
- ๐ Deprecated:
- Deprecated
que_state_notify
trigger (que_state
notification channel /job_change
notification message). See #372. We plan to remove this in a future release - let us know on the issue if you desire otherwise.
- Deprecated
๐ This release contains a database migration. You will need to migrate Que to the latest database schema version (7). For example, on ActiveRecord and Rails 6:
class UpdateQueTablesToVersion7 < ActiveRecord::Migration[6.0] def up Que.migrate!(version: 7) end def down Que.migrate!(version: 6) end end
- โ Added:
-
v2.0.0 Changes
August 25, 2022โฌ๏ธ Important: Do not upgrade straight to Que 2. You will need to first update to the latest 1.x version, apply the Que database schema migration, and deploy, before you can safely begin the process of upgrading to Que 2. See the 2.0.0.beta1 changelog entry for details.
๐ See beta 2.0.0.beta1, plus:
- ๐ Fixed:
- Updated to use non-deprecated method from PG when params are passed (
#async_exec_params
). #374
- Updated to use non-deprecated method from PG when params are passed (
๐ Note that @dtcristo submitted a PR proposing an easier upgrade path to Que 2 and Ruby 3 - #365. We are yet to properly consider this, but a later release which includes this feature would mean you don't need to simultaneously deploy Que 1.x and 2.x workers during the upgrade.
- ๐ Fixed:
-
v2.0.0.beta1 Changes
March 24, 2022๐ Preliminary release of Ruby 3 support
Notable changes:
- ๐ Support for Ruby 3 introduced
- ๐ท Database schema has changed to split the job arguments
args
column intoargs
andkwargs
columns, for reliable args and kwargs splitting for Ruby 3.- The job schema version is now 2. Note that job schema version is distinct from database schema version and Que version. The
job_schema_version
column of theque_jobs
table no longer defaults and has a not null constraint, so when manually inserting jobs into the table, this must be specified as2
. If you have a gem that needs to support multiple Que versions, best not to blindly use the value ofQue.job_schema_version
; instead have different code paths depending on the value ofQue.job_schema_version
. You could also use this to know whether keyword arguments are inargs
orkwargs
.
- The job schema version is now 2. Note that job schema version is distinct from database schema version and Que version. The
- ๐ท Passing a hash literal as the last job argument to be splatted into job keyword arguments is no longer supported.
- ๐ท Dropped support for providing job options as top-level keyword arguments to
Job.enqueue
, i.e.queue
,priority
,run_at
,job_class
, andtags
. Job options now need to be nested under thejob_options
keyword argument instead. See #336 - โฌ๏ธ Dropped support for Ruby < 2.7
- โฌ๏ธ Dropped support for Rails < 6.0
- โฑ The
#by_args
method on the Job model (for both Sequel and ActiveRecord) now searches based on both args and kwargs, but it performs a subset match instead of an exact match. For instance, if your job was scheduled with'a', 'b', 'c', foo: 'bar', baz: 1
,by_args('a', 'b', baz: 1)
would find and return the job. - ๐ This release contains a database migration. You will need to migrate Que to the latest database schema version (6). For example, on ActiveRecord and Rails 6:
class UpdateQueTablesToVersion6 < ActiveRecord::Migration[6.0] def up Que.migrate!(version: 6) end def down Que.migrate!(version: 5) end end
โฌ๏ธ Recommended upgrade process:
๐ท When using Que 2.x, a job enqueued with Ruby 2.7 will run as expected on Ruby 3. We recommend:
โฌ๏ธ 1. Upgrade your project to the latest 1.x version of Que (1.3.1+) - IMPORTANT: adds support for zero downtime upgrade to Que 2.x, see changelog below โฌ๏ธ 2. Upgrade your project to Ruby 2.7 and Rails 6.x if it is not already โฌ๏ธ 3. Upgrade your project to Que 2.x but stay on Ruby 2.7 - IMPORTANT: You will need to continue to run Que 1.x workers until all jobs enqueued using Que 1.x (i.e. with a
job_schema_version
of1
) have been finished. See below โฌ๏ธ 4. Upgrade your project to Ruby 3NOTES:
- If you were already running Ruby 2.7 and were not passing a hash literal as the last job argument, you may be able to upgrade a running system without draining the queue, though this is not recommended.
- โฌ๏ธ For all other cases, you will need to follow the recommended process above or first completely drain the queue (stop enqueuing new jobs and finish processing any jobs in the database, including cleaning out any expired jobs) before upgrading.
๐ Deploying Que 1.x and 2.x workers simultaneously:
๐ท To run workers with two different versions of Que, you'll probably need to temporarily duplicate your gem bundle, with the Que version being the only difference. e.g.:
- ๐ Copy your
Gemfile
andGemfile.lock
into a directory calledque-1-gemfile
- Set a suitable Que version in each
Gemfile
- โก๏ธ Update the bundle at
que-1-gemfile/Gemfile.lock
usingBUNDLE_GEMFILE=que-1-gemfile/Gemfile bundle
- ๐ Create a second deployment of Que, but with your
que
command prefixed withBUNDLE_GEMFILE=que-1-gemfile/Gemfile
โฌ๏ธ We'd appreciate feedback on your experience upgrading to and running Que 2. Feel free to post on our Discord, or if you run into trouble, open an issue on GitHub.
-
v1.4.1 Changes
July 24, 2022- โ Added
- Added Ruby version requirement of < 3. For Ruby 3 compatibility, upgrade to Que 2 - upgrade process
- โ Added
-
v1.4.0 Changes
March 23, 2022- ๐ Fixed
- 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.
- An alternative was considered which skipped polling when only some of the waiting worker priorities would be fully utilised (diagram explanation); but this was decided against for code complexity reasons. #348
- 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.
- ๐ Deprecated:
- Deprecated
--minimum-buffer-size
option. It was not actually used, and will be removed in v2.0.0. #346- It became used in 1.0.0.beta4, and that changelog entry has been updated to reflect this.
- Deprecated
- ๐ Documentation:
- Reformatted the changelog to be more consistent, including adding links to all issue/PR numbers. #347
- ๐ Fixed
-
v1.3.1 Changes
February 25, 2022โฌ๏ธ Unfortunately, v1.3.0 was broken. Follow its upgrade instructions, but use this version instead.
- ๐ Fixed
- Fixed startup error:
undefined method 'job_schema_version' for Que:Module
, in #343
- Fixed startup error:
- ๐ Fixed
-
v1.3.0 Changes
February 25, 2022ACTION REQUIRED
๐ This release will allow you to safely upgrade to Que 2 when it comes out, without first needing to empty your
que_jobs
table.๐ 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.
๐ท 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.โฌ๏ธ 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.๐ท 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 a1
here, and jobs from Que 2 will have a2
. Que schema migration 5 will default the job schema version of all existing jobs to1
.โ You will need to migrate Que to the latest Que schema version (5). For instance, on ActiveRecord and Rails 6:
class UpdateQueTablesToVersion5 < ActiveRecord::Migration[6.0] def up Que.migrate!(version: 5) end def down Que.migrate!(version: 4) end end
๐ You must apply the schema migration and deploy to upgrade all workers.
๐ 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.
โก๏ธ 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 thekwargs
column, and when inserting jobs, put a2
into thejob_schema_version
column rather than continue to rely on its soon-to-be-removed default of1
.Other improvements:
-
v1.2.0 Changes
February 23, 2022- ๐ Deprecated
- 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 thejob_options
keyword arg instead. See #336
- Providing job options as top level keyword arguments to Job.enqueue is now deprecated. Support will be dropped in
- ๐ Deprecated
-
v1.1.0 Changes
February 21, 2022