Changeset dadc4da


Ignore:
Timestamp:
Mar 1, 2010 11:07:01 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
f52f5df
Parents:
9c2e4e1
Message:

revocation conrtol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r9c2e4e1 rdadc4da  
    10751075        # Wait until all finish (keep pinging the log, though)
    10761076        mins = 0
     1077        revoked = False
    10771078        while not thread_pool.wait_for_all_done(60.0):
    10781079            mins += 1
    10791080            alloc_log.info("Waiting for sub threads (it has been %d mins)" \
    10801081                    % mins)
     1082            if not revoked and \
     1083                    len([ t.getName() for t in threads if not t.rv ]) > 0:
     1084                # a testbed has failed.  Revoke this experiment's
     1085                # synchronizarion values so that sub experiments will not
     1086                # deadlock waiting for synchronization that will never happen
     1087                self.log.info("A subexperiment has failed to swap in, " + \
     1088                        "revoking synch keys")
     1089                var_key = "fedid:%s" % expid
     1090                for k in self.synch_store.all_keys():
     1091                    if len(k) > 45 and k[0:46] == var_key:
     1092                        self.synch_store.revoke_key(k)
     1093                revoked = True
    10811094
    10821095        thread_pool.clear()
     
    26592672                    if len(k) > 45 and k[0:46] in fedid_keys:
    26602673                        self.synch_store.del_value(k)
    2661                 except synch_store.BadDeleteionError:
     2674                except synch_store.BadDeletionError:
    26622675                    pass
    26632676            self.write_store()
     
    26872700
    26882701        if self.auth.check_attribute(fid, name):
    2689             v = self.synch_store.get_value(name, wait)
     2702            try:
     2703                v = self.synch_store.get_value(name, wait)
     2704            except synch_store.RevokedKeyError:
     2705                # No more synch on this key
     2706                raise service_error(service_error.federant,
     2707                        "Synch key %s revoked" % name)
    26902708            if v is not None:
    26912709                rv['value'] = v
     
    27172735                raise service_error(service_error.req,
    27182736                        "Value already set: %s" %name)
     2737            except synch_store.RevokedKeyError:
     2738                # No more synch on this key
     2739                raise service_error(service_error.federant,
     2740                        "Synch key %s revoked" % name)
    27192741            return { 'name': name, 'value': v }
    27202742        else:
Note: See TracChangeset for help on using the changeset viewer.