Skip to content

Commit

Permalink
Fix job not being recorded as completed when exit status > 127
Browse files Browse the repository at this point in the history
Kuroko would fail to record the completion of the job when it exits
with status bigger than 127 as it causes an ActiveModel::RangeError.
  • Loading branch information
kaorimatz committed May 9, 2017
1 parent 0382965 commit ddb10ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions db/migrate/028_change_exit_status_to_unsigned_tinyint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class ChangeExitStatusToUnsignedTinyint < ActiveRecord::Migration
def up
change_column :executions, :exit_status, 'tinyint(4) unsigned'
end

def down
change_column :executions, :exit_status, :integer, limit: 1
end
end
4 changes: 2 additions & 2 deletions spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 27) do
ActiveRecord::Schema.define(version: 28) do

create_table "admin_assignments", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "user_id", null: false
Expand All @@ -31,7 +31,7 @@
t.text "context", limit: 65535, null: false
t.integer "pid"
t.text "output", limit: 4294967295
t.integer "exit_status", limit: 1
t.integer "exit_status", limit: 1, unsigned: true
t.integer "term_signal", limit: 1
t.datetime "started_at"
t.datetime "finished_at"
Expand Down

0 comments on commit ddb10ea

Please sign in to comment.