diff options
author | Robert Speicher <robert@gitlab.com> | 2016-02-08 23:50:10 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-09 12:25:37 -0500 |
commit | 1d92669cb076f46e9e99f13a6421c80b12a2ee6a (patch) | |
tree | a9dd0a87431aa5c65329d7a6b0f437291f287710 | |
parent | edf972a53dfc0594f1ce59e676d756d045942c7b (diff) | |
download | gitlab-ce-1d92669cb076f46e9e99f13a6421c80b12a2ee6a.tar.gz |
Merge branch 'backup-database-timeout-fix' into 'master'
Fix timeout issue for rake task gitlab:backup:create
This is a fix for a database timeout which can occur when the backup
create task is taking very long (1-2 hours).
It seems that ActiveRecord is loosing the connection after a hour
idleness and need to be reconnected before use.
See merge request !2757
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/backup/manager.rb | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG index f1174ccab7b..cbeefd97cc3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.4.4 - Update omniauth-saml gem to 1.4.2 + - Prevent long-running backup tasks from timing out the database connection v 8.4.3 - Increase lfs_objects size column to 8-byte integer to allow files larger diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 099062eeb8b..4962f5e53ce 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -1,6 +1,9 @@ module Backup class Manager def pack + # Make sure there is a connection + ActiveRecord::Base.connection.reconnect! + # saving additional informations s = {} s[:db_version] = "#{ActiveRecord::Migrator.current_version}" |