You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/12/02 21:54:00 UTC
svn commit: r1547188 - in /uima/sandbox/uima-ducc/trunk/src/main/admin:
check_ducc ducc_util.py start_ducc
Author: challngr
Date: Mon Dec 2 20:54:00 2013
New Revision: 1547188
URL: http://svn.apache.org/r1547188
Log:
UIMA-3457 Be sure to catch and handle all interrupts or the threading can hang.
Modified:
uima/sandbox/uima-ducc/trunk/src/main/admin/check_ducc
uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/check_ducc
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/check_ducc?rev=1547188&r1=1547187&r2=1547188&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/check_ducc (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/check_ducc Mon Dec 2 20:54:00 2013
@@ -291,16 +291,22 @@ class CheckDucc(DuccUtil):
print "Checking", n_nodes, "nodes"
self.threadpool = ThreadPool(n_nodes + 5) # more for the head processes
checked = {}
- for (nodefile, nodelist) in nodes.items():
- if ( nodelist == None ):
- # loading the nodes prints the necessary message
- continue
- for node in nodelist:
- if ( checked.has_key(node) ):
- continue
- checked[node] = node
- self.threadpool.invoke(self.check_node, node)
+ try:
+ for (nodefile, nodelist) in nodes.items():
+ if ( nodelist == None ):
+ # loading the nodes prints the necessary message
+ continue
+ for node in nodelist:
+ if ( checked.has_key(node) ):
+ continue
+
+ checked[node] = node
+ self.threadpool.invoke(self.check_node, node)
+ except:
+ self.threadpool.quit()
+ print sys.exc_info()[0], "Exiting."
+ sys.exit(1)
self.threadpool.quit()
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1547188&r1=1547187&r2=1547188&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_util.py Mon Dec 2 20:54:00 2013
@@ -588,29 +588,6 @@ class DuccUtil(DuccBase):
#
response.append('ENV: system is ' + self.system)
- #
- # Print the version information from the DUCC jars
- #
-
- #
- #version = manifest.get
- #for j in [\
- # 'uima-ducc-rm.jar',\
- # 'uima-ducc-pm.jar', \
- # 'uima-ducc-orchestrator.jar', \
- # 'uima-ducc-sm.jar', \
- # 'uima-ducc-web.jar', \
- # 'uima-ducc-cli.jar', \
- # 'uima-ducc-agent.jar', \
- # 'uima-ducc-common.jar', \
- # 'uima-ducc-jd.jar',
- # ]:
-
-
-# manifest = DuccProperties()
-# manifest.load_from_manifest(self.DUCC_HOME + '/lib/' + j)
-# response.append('ENV: %25s %18s %12s %s' % (j + ':', manifest.get('Ducc-Version'), 'compiled at', manifest.get('Build-Date')))
-
return response
#
Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc?rev=1547188&r1=1547187&r2=1547188&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/start_ducc Mon Dec 2 20:54:00 2013
@@ -187,7 +187,7 @@ class StartDucc(DuccUtil):
print " component name with a destination node, use the notation component@nodename."
print " Multiple components may be specified:"
print ""
- print " start_ducc -c sm -c pm -c rm@f9n4 -c or@bluej22 -c agent@remote1 -c agent@remote2"
+ print " start_ducc -c sm -c pm -c rm@node1 -c or@node2 -c agent@remote1 -c agent@remote2"
print ""
print " Components include:"
print " rm - resource manager"
@@ -308,7 +308,11 @@ class StartDucc(DuccUtil):
if ( self.is_amq_active() ):
print 'ActiveMQ broker is already running on host and port:', self.broker_host + ':' + self.broker_port, 'NOT restarting'
else:
- self.start_broker()
+ try:
+ self.start_broker()
+ except:
+ print sys.exc_info()[0], "DUCC may not be started correctly."
+ sys.exit(1)
if ( self.is_amq_active() ):
print 'ActiveMQ broker is found on configured host and port:', self.broker_host + ':' + self.broker_port
@@ -328,8 +332,7 @@ class StartDucc(DuccUtil):
self.threadpool.invoke(self.start_one_agent, node, single_user)
except:
self.threadpool.quit()
- traceback.print_exc()
- print "Errors encounted, DUCC may not be started correctly."
+ print sys.exc_info()[0], "DUCC may not be started correctly."
sys.exit(1)
if ( len(components) != 0 ):
@@ -344,8 +347,7 @@ class StartDucc(DuccUtil):
#self.start_component(ducc, com, or_parms, single_user)
except:
self.threadpool.quit()
- traceback.print_exc()
- print "Errors encounted, DUCC may not be started correctly."
+ print sys.exc_info()[0], "DUCC may not be started correctly."
sys.exit(1)
self.threadpool.quit()