capistrano / capistrano/rails

Facing timeout issues on migration step

Open
#234 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
901
Forks
262
PR merge metrics
No merged PRs in 30d

Description

Recently we added timeouts for our database with configuration like
Configuration from `database.yml`
connect_timeout: 5
read_timeout: 5
write_timeout: 5
checkout_timeout: 5
All values are in seconds

---

### Steps to reproduce
When i run `cap production deploy` the deployment fails on migration step and gives error
Mysql2::Error::TimeoutError: Timeout waiting for a response from the last query.

### Expected behavior
We want use `MAX_EXECUTION_TIME=90000 rake db:migrate` during our cap deploy and we will add a variable `max_execution_time` in our `database.yml` which will default to 5 seconds.
Additionally we could inject `read_timeout` also along with it if the max execution time doesn't work alone.

### Actual behavior
We cannot control the injection of this variable because our Capfile uses `capistrano/rails` which will run `rake db:migrate` without maximum execution time and our migration could take much more time than our DB timeouts.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Capfile and the capistrano/rails task that runs rake db:migrate, then review the database.yml timeout settings described in the issue. Check how MAX_EXECUTION_TIME=90000 and the proposed max_execution_time setting would relate to the migration command and MySQL timeouts. Done means the deployment migration can use the requested execution-time or timeout configuration without the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, rails, ruby
Domain
databases, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.