Ignore:
Timestamp:
Mar 18, 2010 11:39:59 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
1627c3d
Parents:
bdf00d5
Message:

Handle replayed StartSegment? calls. SSL sometimes kills the response and this is needed to get the response to the controller w/o redoing the allocation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/protogeni_access.py

    rbdf00d5 rcd06678  
    905905        if not self.auth.check_attribute(fid, auth_attr):
    906906            raise service_error(service_error.access, "Access denied")
     907        else:
     908            # See if this is a replay of an earlier succeeded StartSegment -
     909            # sometimes SSL kills 'em.  If so, replay the response rather than
     910            # redoing the allocation.
     911            self.state_lock.acquire()
     912            retval = self.allocation[aid].get('started', None)
     913            self.state_lock.release()
     914            if retval:
     915                self.log.warning("Duplicate StartSegment for %s: " % aid + \
     916                        "replaying response")
     917                return retval
    907918
    908919
     
    10691080            self.state_lock.acquire()
    10701081            logv = "".join(self.allocation[aid]['log'])
     1082            # It's possible that the StartSegment call gets retried (!).
     1083            # if the 'started' key is in the allocation, we'll return it rather
     1084            # than redo the setup.
     1085            self.allocation[aid]['started'] = {
     1086                    'allocID': req['allocID'],
     1087                    'allocationLog': logv,
     1088                    }
     1089            retval = self.allocation[aid]['started']
    10711090            self.state_lock.release()
    10721091
    1073             return { 'allocID': req['allocID'], 'allocationLog': logv }
     1092            return retval
    10741093        elif err:
    10751094            raise service_error(service_error.federant,
Note: See TracChangeset for help on using the changeset viewer.