Move the pg_stop_backup() into a finally: block.
authorSteve Singer <ssinger@ca.afilias.info>
Thu, 17 Mar 2011 18:18:45 +0000 (20:18 +0200)
committerMartin Pihlak <martin.pihlak@gmail.com>
Thu, 17 Mar 2011 18:19:15 +0000 (20:19 +0200)
Some instances were reported where the base backup failed with some issue
but pg_stop_backup() hadn't been called and had to be called manually.
This should make that less likely

python/walmgr.py

index 5b12980d15dcd12b9e1a39343fee24792913e7c0..dfac72e2612d62208580c0abeca752b65f1c57ce 100755 (executable)
@@ -1144,11 +1144,11 @@ config_backup        = %(config_backup)s
         except Exception, e:
             self.log.error(e)
             errors = True
-
-        try:
-            self.pg_stop_backup()
-        except:
-            pass
+        finally:
+            try:
+                self.pg_stop_backup()
+            except:
+                pass
 
         try:
             self.remote_walmgr("xrelease")