From a434cd446c015980dad5ff97ac5ae33e007a5bb3 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Fri, 2 Oct 2009 20:03:33 +0000 Subject: 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 --- src/lib/Server/Admin/Viz.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib/Server/Admin') 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): -- cgit v1.2.3-1-g7c22