From fa293f172694b42a455f88f6a132305a99b12ff6 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 13 Mar 2015 10:52:49 +0100 Subject: [PATCH] let SystemExit exception go up to the surface so we can exit() and so freeze the system for troubleshooting --- database.py | 4 ++++ nodemanager.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/database.py b/database.py index 7064335..2c4dc49 100644 --- a/database.py +++ b/database.py @@ -13,6 +13,8 @@ In order to maintain service when the node reboots during a network partition, the database is constantly being dumped to disk. """ +import sys + import cPickle import threading import time @@ -156,6 +158,8 @@ It may be necessary in the future to do something smarter.""" if sliver.is_running(): logger.verbose ("database: sync : ensure_create'ing 'delegated' sliver %s"%name) sliver.ensure_created(rec) + except SystemExit as e: + sys.exit(e) except: logger.log_exc("database: sync failed to handle sliver",name=name) diff --git a/nodemanager.py b/nodemanager.py index 7f5e204..0d3009d 100755 --- a/nodemanager.py +++ b/nodemanager.py @@ -117,6 +117,8 @@ class NodeManager: if getattr(module,'persistent_data',False): module_data=last_data callback(data, config, plc) + except SystemExit as e: + sys.exit(e) except: logger.log_exc("nodemanager: GetSlivers failed to run callback for module %r"%module) -- 2.43.0