You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2019/11/14 13:51:40 UTC

svn commit: r1869798 - in /uima/uima-ducc/trunk/src/main/admin: ducc_util.py stop_ducc

Author: burn
Date: Thu Nov 14 13:51:40 2019
New Revision: 1869798

URL: http://svn.apache.org/viewvc?rev=1869798&view=rev
Log:
UIMA-6144 Reorder DB update when stopping in case the cron job restarts it

Modified:
    uima/uima-ducc/trunk/src/main/admin/ducc_util.py
    uima/uima-ducc/trunk/src/main/admin/stop_ducc

Modified: uima/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1869798&r1=1869797&r2=1869798&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/uima-ducc/trunk/src/main/admin/ducc_util.py Thu Nov 14 13:51:40 2019
@@ -186,8 +186,9 @@ class DuccUtil(DuccBase):
         if ( self.broker_decoration != None ):
             self.broker_url = self.broker_url + '?' + self.broker_decoration
         
-        if ( self.webserver_node == None ):
-            self.webserver_node = self.localhost
+        # Obsolete ??
+        #if ( self.webserver_node == None ):
+        #    self.webserver_node = self.localhost
 
     def merge_properties(self):
         # first task, always, merge the properties so subsequent code can depend on their validity.
@@ -1024,8 +1025,9 @@ class DuccUtil(DuccBase):
                 continue
             nodes.append(node)
 
-        if ( self.webserver_node != 'localhost' ):           # might be configured somewhere else
-            nodes.append(self.webserver_node)
+        # obsolete ??
+        #if ( self.webserver_node != 'localhost' ):           # might be configured somewhere else
+        #    nodes.append(self.webserver_node)
 
         for node in nodes:                
             data = self.find_ducc_process(node, user)

Modified: uima/uima-ducc/trunk/src/main/admin/stop_ducc
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/stop_ducc?rev=1869798&r1=1869797&r2=1869798&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/stop_ducc (original)
+++ uima/uima-ducc/trunk/src/main/admin/stop_ducc Thu Nov 14 13:51:40 2019
@@ -469,8 +469,10 @@ class StopDucc(DuccUtil):
                         break
         return pid
     
+    # Note - If this is called after submitting the stop request the autostart cron job may see
+    # that the daemon is down before the DB is updated and restart it!
     def acct_stop(self,node,component):
-        print 'db_acct: Stopped '+component+'@'+node
+        print 'db_acct: Recording '+component+'@'+node+' in DB as Stopped'
         self.db_acct_stop(node,component)
         
     # target=kill
@@ -490,11 +492,11 @@ class StopDucc(DuccUtil):
                 if(pid == None):
                     state='state=component not found'
                 else:
+                    self.acct_stop(node,component)
                     self.ssh(node, True, 'kill', '-'+str(signal), str(pid))
                     process='pid='+str(pid)+' '
             else:
                 state='state=find DUCC process failed'
-            self.acct_stop(node,component)
         else:
             state = 'state=ssh failure'
         msg = pfx+process+state
@@ -563,23 +565,23 @@ class StopDucc(DuccUtil):
             if(component == self.c_database):
                 stop_db = True
                 continue
+            self.acct_stop(node,com)
             item = component+'@'+node
             if(qflag):
                 self.ducc_admin('--quiesce',item)
             else:
                 self.ducc_admin('--stop',item)
-            self.acct_stop(node,com)
 
         # Finally stop broker & database if requested
         node = self.localhost
         if(stop_broker):
             print 'Stopping: broker'
-            self.stop_broker()
             self.acct_stop(node,self.c_br)
+            self.stop_broker()
         if(stop_db):
             print 'Stopping: database'
-            self.db_stop()
             self.acct_stop(node,self.c_db)
+            self.db_stop()
     
     # multi-thread lock to obtain thread id
     lock_tid = Lock()