From 1d92669cb076f46e9e99f13a6421c80b12a2ee6a Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 8 Feb 2016 23:50:10 +0000 Subject: 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 --- CHANGELOG | 1 + lib/backup/manager.rb | 3 +++ 2 files changed, 4 insertions(+) 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}" -- cgit v1.2.1