def msg_prepare_preempted(self, conn, msg):
        """MSG_PREPARE_PREEMPTED is handled only if it belongs to an outstanding MSG_PREPARE,
        otherwise it is discarded.
        A MSG_PREPARE_PREEMPTED causes the PREPARE STAGE to be unsuccessful, hence the current
        state is deleted and a ne PREPARE STAGE is initialized.

        State Updates:
        - kill the PREPARE STAGE that received a MSG_PREPARE_PREEMPTED
        -- remove the old ResponseCollector from the outstanding prepare set
        - remove the command from proposals, add it to pendingcommands
        - update the ballotnumber
        - initiate command
        """
        if msg.inresponseto in self.outstandingprepares:
            prc = self.outstandingprepares[msg.inresponseto]
            if self.debug: self.logger.write("Paxos State",
                                             "got a reject for ballotno %s proposal %s with %d/%d"
                                             % (prc.ballotnumber, prc.proposal,
                                                prc.receivedcount, prc.ntotal))
            # take this response collector out of the outstanding prepare set
            del self.outstandingprepares[msg.inresponseto]
            # become inactive
            self.active = False
            # handle reject
            self._handlereject(msg, prc)
dataset/ETHPy150Open denizalti/concoord/concoord/replica.py/Replica.msg_prepare_preempted/original