From ce5d4e35f9bf59d82eec5118116cc2eb97261291 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 6 Jan 2008 19:56:42 +0000 Subject: [PATCH] ebl Fixes #1034 which cause mysql to hang the connection after 8 hours. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6246 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.7-mysql-batch-timeout.patch | 15 +++++++++++++++ bacula/src/cats/mysql.c | 4 ++++ bacula/technotes-2.3 | 1 + 3 files changed, 20 insertions(+) create mode 100644 bacula/patches/2.2.7-mysql-batch-timeout.patch diff --git a/bacula/patches/2.2.7-mysql-batch-timeout.patch b/bacula/patches/2.2.7-mysql-batch-timeout.patch new file mode 100644 index 0000000000..0ee9d624e5 --- /dev/null +++ b/bacula/patches/2.2.7-mysql-batch-timeout.patch @@ -0,0 +1,15 @@ +Index: src/cats/mysql.c +=================================================================== +--- src/cats/mysql.c (révision 6192) ++++ src/cats/mysql.c (copie de travail) +@@ -205,6 +205,10 @@ + Dmsg3(100, "opendb ref=%d connected=%d db=%p\n", mdb->ref_count, + mdb->connected, mdb->db); + ++ /* Set connection timeout to 8 days specialy for batch mode */ ++ sql_query(mdb, "SET wait_timeout=691200"); ++ sql_query(mdb, "SET interactive_timeout=691200"); ++ + V(mutex); + return 1; + } diff --git a/bacula/src/cats/mysql.c b/bacula/src/cats/mysql.c index 8a2832b0ba..514f7103d0 100644 --- a/bacula/src/cats/mysql.c +++ b/bacula/src/cats/mysql.c @@ -205,6 +205,10 @@ db_open_database(JCR *jcr, B_DB *mdb) Dmsg3(100, "opendb ref=%d connected=%d db=%p\n", mdb->ref_count, mdb->connected, mdb->db); + /* Set connection timeout to 8 days specialy for batch mode */ + sql_query(mdb, "SET wait_timeout=691200"); + sql_query(mdb, "SET interactive_timeout=691200"); + V(mutex); return 1; } diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index f2a8c8a18d..366a13fd94 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -2,6 +2,7 @@ General: 06Jan08 +ebl Fixes #1034 which cause mysql to hang the connection after 8h ebl Change default statistics target of filename.name and path.path fields for PostgreSQL. This speeds lookup by indexes. Thanks to Marc Cousin. -- 2.39.5