Index: fedd/federation/experiment_control.py
===================================================================
--- fedd/federation/experiment_control.py	(revision c570f7e39d7bbca764590643d28d596b2f880afc)
+++ fedd/federation/experiment_control.py	(revision 9479343fc514b5de505cef2fb07a95070aeafd94)
@@ -1836,7 +1836,22 @@
         if req.has_key('experimentID') and \
                 req['experimentID'].has_key('localname'):
+	    overwrite = False
             eid = req['experimentID']['localname']
+	    # If there's an old failed experiment here with the same local name
+	    # and accessible by this user, we'll overwrite it, otherwise we'll
+	    # fall through and do the collision avoidance.
+	    old_expid = self.get_experiment_fedid(eid)
+	    if old_expid and self.check_experiment_access(fid, old_expid):
+		self.state_lock.acquire()
+		status = self.state[eid].get('experimentStatus', None)
+		if status and status == 'failed':
+		    # remove the old access attribute
+		    self.auth.unset_attribute(fid, old_expid)
+		    overwrite = True
+		    del self.state[eid]
+		    del self.state[old_expid]
+		self.state_lock.release()
             self.state_lock.acquire()
-            while (self.state.has_key(eid)):
+            while (self.state.has_key(eid) and not overwrite):
                 eid += random.choice(string.ascii_letters)
 	    # Initial state
@@ -2068,4 +2083,36 @@
 
 	return rv
+    
+    def get_experiment_fedid(self, key):
+        """
+	find the fedid associated with the localname key in the state database.
+        """
+
+	rv = None
+	self.state_lock.acquire()
+	if self.state.has_key(key):
+	    if isinstance(self.state[key], dict):
+		try:
+		    kl = [ f['fedid'] for f in \
+			    self.state[key]['experimentID']\
+				if f.has_key('fedid') ]
+		except KeyError:
+		    self.state_lock.release()
+		    raise service_error(service_error.internal, 
+			    "No fedid for experiment %s when getting "+\
+				    "fedid(!?)" % key)
+		if len(kl) == 1:
+		    rv = kl[0]
+		else:
+		    self.state_lock.release()
+		    raise service_error(service_error.internal, 
+			    "multiple fedids for experiment %s when " +\
+				    "getting fedid(!?)" % key)
+	    else:
+		self.state_lock.release()
+		raise service_error(service_error.internal, 
+			"Unexpected state for %s" % key)
+	self.state_lock.release()
+	return rv
 
     def check_experiment_access(self, fid, key):
@@ -2076,38 +2123,5 @@
         """
         if not isinstance(key, fedid):
-            self.state_lock.acquire()
-            if self.state.has_key(key):
-                if isinstance(self.state[key], dict):
-                    try:
-                        kl = [ f['fedid'] for f in \
-                                self.state[key]['experimentID']\
-                                    if f.has_key('fedid') ]
-                    except KeyError:
-                        self.state_lock.release()
-                        raise service_error(service_error.internal, 
-                                "No fedid for experiment %s when checking " +\
-                                        "access(!?)" % key)
-                    if len(kl) == 1:
-                        key = kl[0]
-                    else:
-                        self.state_lock.release()
-                        raise service_error(service_error.internal, 
-                                "multiple fedids for experiment %s when " +\
-                                        "checking access(!?)" % key)
-                elif isinstance(self.state[key], str):
-                    self.state_lock.release()
-                    raise service_error(service_error.internal, 
-                            ("experiment %s is placeholder.  " +\
-                                    "Creation in progress or aborted oddly") \
-                                    % key)
-                else:
-                    self.state_lock.release()
-                    raise service_error(service_error.internal, 
-                            "Unexpected state for %s" % key)
-
-            else:
-                self.state_lock.release()
-                raise service_error(service_error.access, "Access Denied")
-            self.state_lock.release()
+	    key = self.get_experiment_fedid(key)
 
         if self.auth.check_attribute(fid, key):
@@ -2389,5 +2403,4 @@
                         'aid': aid,\
                     }
-		print "%s %s" % (tb, tbparams[tb])
 	    fed_exp['experimentStatus'] = 'terminating'
             if self.state_filename: self.write_state()
