Folks, In the code below, isn't there a 3rd case where the offer was "used" and hence not found for canceling?
Mohit. public void handleRescind(OfferID offerId) { log.info("Offer rescinded: {}", offerId.getValue()); // For rescinds, we want to ensure they are processed quickly before we attempt to use an // invalid offer. There are a few scenarios we want to be aware of: // 1. We receive an offer, add it to OfferManager, and then get a rescind. In this scenario, // we can just remove the offer from the offers list. // 2. We receive an offer, but before we add it to the OfferManager list we get a rescind. // In this scenario, we want to ensure that we do not use it/accept it when the executor // finally processes the offer. We will temporarily ban it and add a command for the // executor to unban it so future offers can be processed normally. boolean offerCancelled = offerManager.cancelOffer(offerId);