def move_task_request(self, ts, victim, thief) -> str:
    try:
        if (ts in self.in_flight):
            return 'in-flight'
        stimulus_id = f'steal-{time()}'
        key = ts.key
        self.remove_key_from_stealable(ts)
        logger.debug('Request move %s, %s: %2f -> %s: %2f', key, victim, victim.occupancy, thief, thief.occupancy)
        victim_duration = victim.processing[ts]
        thief_duration = (self.scheduler.get_task_duration(ts) + self.scheduler.get_comm_cost(ts, thief))
        self.scheduler.stream_comms[victim.address].send({'op': 'steal-request', 'key': key, 'stimulus_id': stimulus_id})
        self.in_flight[ts] = {'victim': victim, 'thief': thief, 'victim_duration': victim_duration, 'thief_duration': thief_duration, 'stimulus_id': stimulus_id}
        self._in_flight_event.clear()
        self.in_flight_occupancy[victim] -= victim_duration
        self.in_flight_occupancy[thief] += thief_duration
        return stimulus_id
    except CommClosedError:
        logger.info('Worker comm %r closed while stealing: %r', victim, ts)
        return 'comm-closed'
    except Exception as e:
        logger.exception(e)
        if LOG_PDB:
            import pdb
            pdb.set_trace()
        raise
def move_task_request(self, ts, victim, thief) -> str:
    try:
        if (ts in self.in_flight):
            return 'in-flight'
        stimulus_id = f'steal-{time()}'
        key = ts.key
        self.remove_key_from_stealable(ts)
        logger.debug('Request move %s, %s: %2f -> %s: %2f', key, victim, victim.occupancy, thief, thief.occupancy)
        victim_duration = victim.processing[ts]
        thief_duration = (self.scheduler.get_task_duration(ts) + self.scheduler.get_comm_cost(ts, thief))
        self.scheduler.stream_comms[victim.address].send({'op': 'steal-request', 'key': key, 'stimulus_id': stimulus_id})
        self.in_flight[ts] = {'victim': victim, 'thief': thief, 'victim_duration': victim_duration, 'thief_duration': thief_duration, 'stimulus_id': stimulus_id}
        self._in_flight_event.clear()
        self.in_flight_occupancy[victim] -= victim_duration
        self.in_flight_occupancy[thief] += thief_duration
        return stimulus_id
    except CommClosedError:
        logger.info('Worker comm %r closed while stealing: %r', victim, ts)
        return 'comm-closed'
    except Exception as e:
        logger.exception(e)
        if LOG_PDB:
            import pdb
            pdb.set_trace()
        raise