Changeset 1627c3d for fedd/federation


Ignore:
Timestamp:
Mar 18, 2010 11:44:26 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
f8ae7aa
Parents:
cd06678
Message:

Protect dragon from StartSegment? replays. Also writeout the replay protection in the other access controllers.

Location:
fedd/federation
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/dragon_access.py

    rcd06678 r1627c3d  
    800800            raise service_error(service_error.access, "Access denied")
    801801        else:
    802             certfile = "%s/%s.pem" % (self.certdir, aid)
     802            # See if this is a replay of an earlier succeeded StartSegment -
     803            # sometimes SSL kills 'em.  If so, replay the response rather than
     804            # redoing the allocation.
     805            self.state_lock.acquire()
     806            retval = self.allocation[aid].get('started', None)
     807            self.state_lock.release()
     808            if retval:
     809                self.log.warning("Duplicate StartSegment for %s: " % aid + \
     810                        "replaying response")
     811                return retval
     812
     813        certfile = "%s/%s.pem" % (self.certdir, aid)
    803814
    804815        if req.has_key('segmentdescription') and \
     
    853864            self.state[aid]['gri'] = gri
    854865            logv = "".join(self.state[aid]['log'])
    855             self.write_state()
    856             self.state_lock.release()
    857 
    858             return {
     866            # It's possible that the StartSegment call gets retried (!).
     867            # if the 'started' key is in the allocation, we'll return it rather
     868            # than redo the setup.
     869            self.allocation[aid]['started'] = {
    859870                    'allocID': req['allocID'],
    860871                    'allocationLog': logv,
    861872                    }
     873            retval = self.allocation[aid]['started']
     874            self.write_state()
     875            self.state_lock.release()
     876
     877            return retval
    862878        elif err:
    863879            raise service_error(service_error.federant,
  • fedd/federation/emulab_access.py

    rcd06678 r1627c3d  
    15231523                    }
    15241524            retval = self.allocation[aid]['started']
     1525            self.write_state()
    15251526            self.state_lock.release()
    15261527
  • fedd/federation/protogeni_access.py

    rcd06678 r1627c3d  
    10881088                    }
    10891089            retval = self.allocation[aid]['started']
     1090            self.write_state()
    10901091            self.state_lock.release()
    10911092
Note: See TracChangeset for help on using the changeset viewer.