que-rb/que

Migration to v. 2.2.0 failed

dima4p opened this issue · 2 comments

My current version of que is 3b7fccc with one fix for ruby 3.

diff --git a/bin/command_line_interface.rb b/bin/command_line_interface.rb
index bfbf7dd..a87e5c0 100644
--- a/bin/command_line_interface.rb
+++ b/bin/command_line_interface.rb
@@ -221,7 +221,7 @@ OUTPUT
 
         locker =
           begin
-            Que::Locker.new(options)
+            Que::Locker.new(**options)
           rescue => e
             output.puts(e.message)
             return 1
diff --git a/lib/que/worker.rb b/lib/que/worker.rb
index 656f0b7..91e7d02 100644
--- a/lib/que/worker.rb
+++ b/lib/que/worker.rb
@@ -125,7 +125,7 @@ module Que
           log_message[:event] = :job_worked
         end
 
-        Que.log(log_message)
+        Que.log(**log_message)
       end
 
       instance

The migration is

class Que7 < ActiveRecord::Migration[7.0]
  def up
    # The current version as of this migration's creation.
    Que.migrate! version: 7
  end

  def down
    # Completely removes Que's job queue.
    Que.migrate! version: 5
  end
end

All works until I've updated and migrated. After that no job is being executed.

What is the problem?

That doesn't sound good. Please provide more information:

  • If you're referring only to jobs that were enqueued from Que 1.x, did you follow the documented required upgrade process?
  • What version of Rails?
  • What other versions of Que are affected?
  • Do you think this is related to your other issue, #381?
  • Does the issue persist after recreating Que's tables with Que.migrate!(version: 0); Que.migrate!(version: 7)?
  • Does it only affect ActiveJob jobs?
  • What is the contents of the que_jobs table?

That doesn't sound good. Please provide more information:

* If you're referring only to jobs that were enqueued from Que 1.x, did you follow the documented required upgrade process?

Both. I suspected that it could be the reason and therefore tried to create a new jobs. They were also ignored. I hope I did follow.

* What version of Rails?

I've tried both wit my current 7.0.2.3 and with the latest 7.0.3.1. Same result.

* What other versions of Que are affected?

I've tried only the two versions I mentioned.

* Do you think this is related to your other issue, [Migration to v. 2.2.0 failed #381](https://github.com/que-rb/que/issues/381)?

It seems to be the link to my issue. I did not find any other one that could fit.

* Does the issue persist after recreating Que's tables with `Que.migrate!(version: 0); Que.migrate!(version: 7)`?

If I've dropped the tables, will Que.migrate!(version: 0) recreate them?

* Does it only affect ActiveJob jobs?

I did not check anything else. What is in the list to investigate?

* What is the contents of the `que_jobs` table?

Now it is empty, as I have rolled back to dima4p@738bbf9 and finished them all.