I've suggested some proposals to Rails here and would love to propose a PR based on the solution that makes the most sense, too.
I've suggested some proposals to Rails here and would love to propose a PR based on the solution that makes the most sense, too.
That all said, still would be cool to make this the default in Active Record. Nice idea!
I have a job that runs nightly or weekly and performs a concurrent reindex on tables, which nicely covers cases like this.
Given that lock timeouts are very much "rescuable," I'm also thinking about addressing the problem right at the start (when adding migrations) by implementing retries. This approach at least would eliminate the need for any follow-up steps by developers and reduce additional cognitive load.
The ideal goal being "The system just works"™ :D
Lock Timeout Retries [experimental] https://github.com/ankane/strong_migrations