Skip to content

Raise early and with more helpful message

Andreas Brandl requested to merge ab/lock-retries-exception into master

What does this MR do and why?

Now that we have enable_lock_retries! available, we can also be a bit more helpful with respect to the deprecated usage of with_lock_retries and what to do instead. This only adds a runtime exception with pointers.

See !69658 (merged)

How to set up and validate locally

This should raise when migrating up:

class TestMigration < Gitlab::Database::Migration[1.0]
  def up
    with_lock_retries do
      execute 'select 1'
    end
  end

  def down
  end
end

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andreas Brandl

Merge request reports