summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Admin/Viz.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-10-02 20:03:33 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-10-02 20:03:33 +0000
commita434cd446c015980dad5ff97ac5ae33e007a5bb3 (patch)
treef7d1dca489928cfd0ae3d82984ee2506b6b95f66 /src/lib/Server/Admin/Viz.py
parentdffae2e4c1b978996ffcb42657554a4fa4b721c7 (diff)
downloadbcfg2-a434cd446c015980dad5ff97ac5ae33e007a5bb3.tar.gz
bcfg2-a434cd446c015980dad5ff97ac5ae33e007a5bb3.tar.bz2
bcfg2-a434cd446c015980dad5ff97ac5ae33e007a5bb3.zip
Fix nasty core hang, which would manifest itself as a lockup upon shutdown for bcfg2-{server,info,admin}
The root cause of this issue was our use of external threads. Without a channel for data requesting plugin (and hence thread) shutdown, plugin threads would continue, unabated, forever. This would cause the python interpreter to hang forever waiting for a futex. Added a new shutdown method to Bcfg2.Server.Plugin.Plugin which sets a state flag upon shutdown request. Plugin threads must cycle periodically, even if no work is available, to ensure that the shutdown flag is honored in a reasonable amount of time. Also, the shutdown method is triggered using atexit. This means that scripts may need to explicitly sys.exit or raise SystemExit, depending on circumstances. This addresses at least one, but probably more tickets, however I am currently offline. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5472 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Admin/Viz.py')
-rw-r--r--src/lib/Server/Admin/Viz.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py
index 3451c56ae..a6dd6682c 100644
--- a/src/lib/Server/Admin/Viz.py
+++ b/src/lib/Server/Admin/Viz.py
@@ -58,6 +58,7 @@ class Viz(Bcfg2.Server.Admin.MetadataCore):
data = self.Visualize(self.get_repo_path(), hset, bset,
kset, outputfile)
print data
+ raise SystemExit, 0
def Visualize(self, repopath, hosts=False,
bundles=False, key=False, output=False):