Even if the refcount is >0, we want to actually reconnect.
Also, log something if the close fails.

Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 tcl/JobDB-Executive.tcl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index 1763b69..6c7e067 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -125,9 +125,12 @@ proc db-ensure-closed {} {
 }
 
 proc db-reopen {} {
+    variable dbusers
     logputs stdout "** reopening database **"
-    catch { db-close }
-    db-open
+    if {[catch { db-ensure-closed } emsg]} {
+       logputs stdout "(db disconnect: $emsg)"
+    }
+    if {$dbusers > 0} db-ensure-open
 }
 
 proc db-update-1 {stmt} {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to